feat(network): Support for fetching all Sonarr tasks
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user