Files
managarr/src/network/servarr_test_utils.rs
T
Dark-Alex-17 d08f7d4b4e test: give the shared IndexerSettings fixture distinct field values
minimum_age and retention were both 1, so transposing them in any code that reads both rendered identically and no test could tell the difference. id was also 1, which cannot distinguish a correctly threaded value from a hardcode.

Verified by transposing minimum_age and retention in the Sonarr indexer settings UI: that mutation survived the full suite before this change and is now caught by the settings snapshot.
2026-09-09 16:31:05 -06:00

47 lines
1.3 KiB
Rust

use crate::models::servarr_data::modals::IndexerTestResultModalItem;
use crate::models::servarr_models::{DiskSpace, IndexerSettings, QueueEvent};
use chrono::DateTime;
pub fn diskspace() -> DiskSpace {
DiskSpace {
path: Some("/path".to_owned()),
free_space: 6500,
total_space: 8675309,
}
}
pub fn indexer_settings() -> IndexerSettings {
IndexerSettings {
id: 7,
minimum_age: 13,
retention: 21,
maximum_size: 12345,
rss_sync_interval: 60,
}
}
pub fn indexer_test_result() -> IndexerTestResultModalItem {
IndexerTestResultModalItem {
name: "DrunkenSlug".to_owned(),
is_valid: false,
validation_failures: "Some failure".into(),
}
}
pub fn queued_event() -> QueueEvent {
QueueEvent {
trigger: "manual".to_string(),
name: "Refresh Monitored Downloads".to_string(),
command_name: "Refresh Monitored Downloads".to_string(),
status: "completed".to_string(),
queued: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T21:25:16Z").unwrap()),
started: Some(DateTime::from(
DateTime::parse_from_rfc3339("2023-05-20T21:25:30Z").unwrap(),
)),
ended: Some(DateTime::from(
DateTime::parse_from_rfc3339("2023-05-20T21:28:33Z").unwrap(),
)),
duration: Some("00:03:03".to_owned()),
}
}