From b157e34176858766738be7e6903cc188285a5aeb Mon Sep 17 00:00:00 2001 From: Namilskyy Date: Mon, 1 Dec 2025 14:17:47 +0300 Subject: Formatted code && fix clippy warn --- tests/i2p_functions.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/i2p_functions.rs') 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> { ... } // #[test] - // fn test_parse_http_response() { ... } + // fn test_parse_http_response() { ... } /* #[tokio::test] async fn test_i2p_fetch_index_success() -> Result<(), Box> { @@ -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()); -- cgit v1.2.3