diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-12-01 15:13:48 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-12-01 15:13:48 +0300 |
| commit | 4262072d0d79449da6b94fb8863064c3fe7998d5 (patch) | |
| tree | a69c2df5792de1b90b6cdc5309158c056b749963 /tests | |
| parent | 4030a202f8f2eeb20d0ecb547a9d656a8e2821c5 (diff) | |
Fixed test logic
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/http_funcs.rs | 4 | ||||
| -rw-r--r-- | tests/pkgtoolkit_funcs.rs | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/http_funcs.rs b/tests/http_funcs.rs index b5b0e5e..a495b3a 100644 --- a/tests/http_funcs.rs +++ b/tests/http_funcs.rs @@ -61,6 +61,9 @@ license = "MIT" let config = create_test_config(temp_config_dir.path().to_str().unwrap()); let mut config_with_mock_url = config.clone(); + + config_with_mock_url.repo.repo_http_url = Some(server.url()); + config_with_mock_url.repo.repo_url = server.url(); let mut http_pkg = HTTPPackage::new(config_with_mock_url); @@ -124,6 +127,7 @@ license = "MIT" let temp_config_dir = TempDir::new()?; let config = create_test_config(temp_config_dir.path().to_str().unwrap()); let mut config_with_mock_url = config.clone(); + config_with_mock_url.repo.repo_http_url = Some(server.url()); config_with_mock_url.repo.repo_url = server.url(); let mut http_pkg = HTTPPackage::new(config_with_mock_url); diff --git a/tests/pkgtoolkit_funcs.rs b/tests/pkgtoolkit_funcs.rs index 667592d..3406844 100644 --- a/tests/pkgtoolkit_funcs.rs +++ b/tests/pkgtoolkit_funcs.rs @@ -1,4 +1,5 @@ use mesk::pkgtoolkit::pkgtools::{Archs, Package}; +use mesk::cfg::config::Config; mod shared; use shared::create_test_config; @@ -40,7 +41,9 @@ mod package_tests { Package::extract_archive(archive_path.to_str().unwrap())?; - let extracted_file_path = temp_dir.path().join("extracted_test_file.txt"); + let config = Config::parse().unwrap(); + let extracted_file_path = std::path::Path::new(&config.paths.cache_dir) + .join("extracted_test_file.txt"); assert!(extracted_file_path.exists()); let content = fs::read_to_string(extracted_file_path)?; assert_eq!(content, test_file_content); |
