feat(network): Support for fetching all Sonarr tasks

This commit is contained in:
2024-11-22 16:35:39 -07:00
parent 539ad75fe6
commit c54bd2bab0
17 changed files with 267 additions and 64 deletions
+21 -1
View File
@@ -11,7 +11,7 @@ mod tests {
sonarr_models::{
BlocklistItem, BlocklistResponse, DownloadRecord, DownloadsResponse, Episode,
IndexerSettings, Series, SeriesStatus, SeriesType, SonarrHistoryEventType, SonarrHistoryItem,
SonarrSerdeable, SystemStatus,
SonarrSerdeable, SonarrTask, SonarrTaskName, SystemStatus,
},
EnumDisplayStyle, Serdeable,
};
@@ -117,6 +117,14 @@ mod tests {
);
}
#[test]
fn test_task_name_display() {
assert_str_eq!(
SonarrTaskName::ApplicationUpdateCheck.to_string(),
"ApplicationUpdateCheck"
);
}
#[test]
fn test_sonarr_serdeable_from() {
let sonarr_serdeable = SonarrSerdeable::Value(json!({}));
@@ -406,4 +414,16 @@ mod tests {
assert_eq!(sonarr_serdeable, SonarrSerdeable::Tags(tags));
}
#[test]
fn test_sonarr_serdeable_from_tasks() {
let tasks = vec![SonarrTask {
name: "test".to_owned(),
..SonarrTask::default()
}];
let sonarr_serdeable: SonarrSerdeable = tasks.clone().into();
assert_eq!(sonarr_serdeable, SonarrSerdeable::Tasks(tasks));
}
}