diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-12-01 14:17:47 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-12-01 14:17:47 +0300 |
| commit | b157e34176858766738be7e6903cc188285a5aeb (patch) | |
| tree | 5a58fbb2eda53cb4c3fd131f2457fb9639285ad6 /tests/i2p_functions.rs | |
| parent | 3fc368fbd6a818a8f9f210c995d82725d11e6e45 (diff) | |
Formatted code && fix clippy warn
Diffstat (limited to 'tests/i2p_functions.rs')
| -rw-r--r-- | tests/i2p_functions.rs | 16 |
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()); |
