feat(network): Added netwwork support for fetching all indexer settings for Sonarr

This commit is contained in:
2024-11-18 21:19:20 -07:00
parent 4fc2d3c94b
commit 7870bb4b5b
7 changed files with 137 additions and 8 deletions
+28
View File
@@ -10,6 +10,7 @@ mod tests {
LogResponse, MinimumAvailability, Monitor, Movie, MovieHistoryItem, QualityProfile,
QueueEvent, RadarrSerdeable, Release, RootFolder, SystemStatus, Tag, Task, TaskName, Update,
},
servarr_models::{HostConfig, SecurityConfig},
Serdeable,
};
@@ -178,6 +179,18 @@ mod tests {
assert_eq!(radarr_serdeable, RadarrSerdeable::DiskSpaces(disk_spaces));
}
#[test]
fn test_radarr_serdeable_from_host_config() {
let host_config = HostConfig {
port: 1234,
..HostConfig::default()
};
let radarr_serdeable: RadarrSerdeable = host_config.clone().into();
assert_eq!(radarr_serdeable, RadarrSerdeable::HostConfig(host_config));
}
#[test]
fn test_radarr_serdeable_from_downloads_response() {
let downloads_response = DownloadsResponse {
@@ -326,6 +339,21 @@ mod tests {
assert_eq!(radarr_serdeable, RadarrSerdeable::RootFolders(root_folders));
}
#[test]
fn test_radarr_serdeable_from_security_config() {
let security_config = SecurityConfig {
username: Some("Test".to_owned()),
..SecurityConfig::default()
};
let radarr_serdeable: RadarrSerdeable = security_config.clone().into();
assert_eq!(
radarr_serdeable,
RadarrSerdeable::SecurityConfig(security_config)
);
}
#[test]
fn test_radarr_serdeable_from_system_status() {
let system_status = SystemStatus {