summaryrefslogtreecommitdiff
path: root/tests/i2p_functions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i2p_functions.rs')
-rw-r--r--tests/i2p_functions.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/i2p_functions.rs b/tests/i2p_functions.rs
index 6b24d14..3cbc1ac 100644
--- a/tests/i2p_functions.rs
+++ b/tests/i2p_functions.rs
@@ -1,11 +1,11 @@
-use mesk::pkgtoolkit::pkgtools::{Package, Archs};
-use mesk::net::i2p_package::I2PPackage;
+use mesk::net::i2p_package::I2PPackage;
+use mesk::pkgtoolkit::pkgtools::{Archs, Package};
mod shared;
use shared::create_test_config;
use std::collections::HashMap;
-use tempfile::TempDir;
+use tempfile::TempDir;
use tokio;
#[cfg(test)]
@@ -14,7 +14,7 @@ mod i2p_package_tests {
// fn parse_http_response(response_bytes: &[u8]) -> Result<(u16, &[u8]), Box<dyn std::error::Error>> { ... }
// #[test]
- // fn test_parse_http_response() { ... }
+ // fn test_parse_http_response() { ... }
/*
#[tokio::test]
async fn test_i2p_fetch_index_success() -> Result<(), Box<dyn std::error::Error>> {
@@ -26,18 +26,18 @@ mod i2p_package_tests {
let mut mock_session = MockSession::new();
mock_session
.expect_connect()
- .with(eq("dummy.i2p"))
+ .with(eq("dummy.i2p"))
.returning(|_| {
// Возвращаем мок-поток, который возвращает байты архива
let index_toml_content = r#"[[packages]] name = "test-pkg" ... "#;
let mut archive_data = Vec::new();
// ... заполняем archive_data как в test_http_fetch_index_success ...
let response_body = format!(
- "HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n{}",
+ "HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n{}",
archive_data.len(),
std::str::from_utf8(&archive_data).unwrap()
).into_bytes();
- Ok(MockStream::new(response_body))
+ Ok(MockStream::new(response_body))
});
@@ -67,7 +67,7 @@ mod i2p_package_tests {
};
packages_map.insert("test-pkg".to_string(), pkg);
i2p_pkg.index_packages = Some(packages_map);
-
+
let pkg_info = i2p_pkg.fetch_package_info("test-pkg");
assert!(pkg_info.is_ok());