test: Added in unit tests for TUI support for multiple custom named Servarrs

This commit is contained in:
2025-02-27 19:30:17 -07:00
parent 9b63b10118
commit f87e02cd7c
76 changed files with 1635 additions and 1403 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let clear_blocklist_command = RadarrCommand::ClearBlocklist.into();
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
@@ -167,7 +167,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let clear_blocklist_command = SonarrCommand::ClearBlocklist.into();
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
+3 -3
View File
@@ -400,7 +400,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_movie_command = RadarrAddCommand::Movie {
tmdb_id: 1,
root_folder_path: "/test".to_owned(),
@@ -437,7 +437,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_root_folder_command = RadarrAddCommand::RootFolder {
root_folder_path: expected_root_folder_path,
};
@@ -465,7 +465,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_tag_command = RadarrAddCommand::Tag {
name: expected_tag_name,
};
@@ -276,7 +276,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_blocklist_item_command = RadarrDeleteCommand::BlocklistItem {
blocklist_item_id: 1,
};
@@ -307,7 +307,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_download_command = RadarrDeleteCommand::Download { download_id: 1 };
let result =
@@ -333,7 +333,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_indexer_command = RadarrDeleteCommand::Indexer { indexer_id: 1 };
let result =
@@ -363,7 +363,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_movie_command = RadarrDeleteCommand::Movie {
movie_id: 1,
delete_files_from_disk: true,
@@ -393,7 +393,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_root_folder_command = RadarrDeleteCommand::RootFolder { root_folder_id: 1 };
let result =
@@ -419,7 +419,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_tag_command = RadarrDeleteCommand::Tag { tag_id: 1 };
let result =
+12 -12
View File
@@ -865,7 +865,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command = RadarrEditCommand::AllIndexerSettings {
allow_hardcoded_subs: true,
disable_allow_hardcoded_subs: false,
@@ -936,7 +936,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command = RadarrEditCommand::AllIndexerSettings {
allow_hardcoded_subs: false,
disable_allow_hardcoded_subs: true,
@@ -1008,7 +1008,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command = RadarrEditCommand::AllIndexerSettings {
allow_hardcoded_subs: false,
disable_allow_hardcoded_subs: false,
@@ -1055,7 +1055,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_collection_command = RadarrEditCommand::Collection {
collection_id: 1,
enable_monitoring: true,
@@ -1097,7 +1097,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_collection_command = RadarrEditCommand::Collection {
collection_id: 1,
enable_monitoring: false,
@@ -1139,7 +1139,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_collection_command = RadarrEditCommand::Collection {
collection_id: 1,
enable_monitoring: false,
@@ -1187,7 +1187,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_indexer_command = RadarrEditCommand::Indexer {
indexer_id: 1,
name: Some("Test".to_owned()),
@@ -1241,7 +1241,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_indexer_command = RadarrEditCommand::Indexer {
indexer_id: 1,
name: Some("Test".to_owned()),
@@ -1295,7 +1295,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_indexer_command = RadarrEditCommand::Indexer {
indexer_id: 1,
name: Some("Test".to_owned()),
@@ -1345,7 +1345,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_movie_command = RadarrEditCommand::Movie {
movie_id: 1,
enable_monitoring: true,
@@ -1388,7 +1388,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_movie_command = RadarrEditCommand::Movie {
movie_id: 1,
enable_monitoring: false,
@@ -1431,7 +1431,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_movie_command = RadarrEditCommand::Movie {
movie_id: 1,
enable_monitoring: false,
+6 -6
View File
@@ -138,7 +138,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_all_indexer_settings_command = RadarrGetCommand::AllIndexerSettings;
let result = RadarrGetCommandHandler::with(
@@ -164,7 +164,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_host_config_command = RadarrGetCommand::HostConfig;
let result =
@@ -190,7 +190,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_movie_details_command = RadarrGetCommand::MovieDetails { movie_id: 1 };
let result =
@@ -216,7 +216,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_movie_history_command = RadarrGetCommand::MovieHistory { movie_id: 1 };
let result =
@@ -239,7 +239,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_security_config_command = RadarrGetCommand::SecurityConfig;
let result =
@@ -262,7 +262,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_system_status_command = RadarrGetCommand::SystemStatus;
let result =
+3 -3
View File
@@ -147,7 +147,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let result = RadarrListCommandHandler::with(&app_arc, list_command, &mut mock_network)
.handle()
@@ -171,7 +171,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_movie_credits_command = RadarrListCommand::MovieCredits { movie_id: 1 };
let result =
@@ -197,7 +197,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_logs_command = RadarrListCommand::Logs {
events: 1000,
output_in_log_format: false,
+14 -14
View File
@@ -292,7 +292,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let clear_blocklist_command = RadarrCommand::ClearBlocklist;
let result = RadarrCliHandler::with(&app_arc, clear_blocklist_command, &mut mock_network)
@@ -321,7 +321,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let download_release_command = RadarrCommand::DownloadRelease {
guid: "guid".to_owned(),
indexer_id: 1,
@@ -350,7 +350,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let manual_search_command = RadarrCommand::ManualSearch { movie_id: 1 };
let result = RadarrCliHandler::with(&app_arc, manual_search_command, &mut mock_network)
@@ -375,7 +375,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let search_new_movie_command = RadarrCommand::SearchNewMovie {
query: "halo".to_owned(),
};
@@ -402,7 +402,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let start_task_command = RadarrCommand::StartTask {
task_name: RadarrTaskName::ApplicationCheckUpdate,
};
@@ -429,7 +429,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let test_indexer_command = RadarrCommand::TestIndexer { indexer_id: 1 };
let result = RadarrCliHandler::with(&app_arc, test_indexer_command, &mut mock_network)
@@ -451,7 +451,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let test_all_indexers_command = RadarrCommand::TestAllIndexers;
let result = RadarrCliHandler::with(&app_arc, test_all_indexers_command, &mut mock_network)
@@ -476,7 +476,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let trigger_automatic_search_command = RadarrCommand::TriggerAutomaticSearch { movie_id: 1 };
let result = RadarrCliHandler::with(
@@ -505,7 +505,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_tag_command = RadarrCommand::Add(RadarrAddCommand::Tag {
name: expected_tag_name,
});
@@ -532,7 +532,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_blocklist_item_command =
RadarrCommand::Delete(RadarrDeleteCommand::BlocklistItem {
blocklist_item_id: 1,
@@ -592,7 +592,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command =
RadarrCommand::Edit(RadarrEditCommand::AllIndexerSettings {
allow_hardcoded_subs: true,
@@ -632,7 +632,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_all_indexer_settings_command =
RadarrCommand::Get(RadarrGetCommand::AllIndexerSettings);
@@ -662,7 +662,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_movie_credits_command =
RadarrCommand::List(RadarrListCommand::MovieCredits { movie_id: 1 });
@@ -688,7 +688,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let refresh_movie_command =
RadarrCommand::Refresh(RadarrRefreshCommand::Movie { movie_id: 1 });
@@ -96,7 +96,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let result = RadarrRefreshCommandHandler::with(&app_arc, refresh_command, &mut mock_network)
.handle()
@@ -120,7 +120,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let refresh_movie_command = RadarrRefreshCommand::Movie { movie_id: 1 };
let result =
+3 -3
View File
@@ -491,7 +491,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_root_folder_command = SonarrAddCommand::RootFolder {
root_folder_path: expected_root_folder_path,
};
@@ -535,7 +535,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_series_command = SonarrAddCommand::Series {
tvdb_id: 1,
title: "test".to_owned(),
@@ -572,7 +572,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_tag_command = SonarrAddCommand::Tag {
name: expected_tag_name,
};
@@ -309,7 +309,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_blocklist_item_command = SonarrDeleteCommand::BlocklistItem {
blocklist_item_id: 1,
};
@@ -340,7 +340,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_download_command = SonarrDeleteCommand::Download { download_id: 1 };
let result =
@@ -366,7 +366,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_episode_file_command = SonarrDeleteCommand::EpisodeFile { episode_file_id: 1 };
let result =
@@ -392,7 +392,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_indexer_command = SonarrDeleteCommand::Indexer { indexer_id: 1 };
let result =
@@ -418,7 +418,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_root_folder_command = SonarrDeleteCommand::RootFolder { root_folder_id: 1 };
let result =
@@ -448,7 +448,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_series_command = SonarrDeleteCommand::Series {
series_id: 1,
delete_files_from_disk: true,
@@ -478,7 +478,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_tag_command = SonarrDeleteCommand::Tag { tag_id: 1 };
let result =
@@ -333,7 +333,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let download_release_command = SonarrDownloadCommand::Series {
guid: "guid".to_owned(),
indexer_id: 1,
@@ -369,7 +369,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let download_release_command = SonarrDownloadCommand::Season {
guid: "guid".to_owned(),
indexer_id: 1,
@@ -405,7 +405,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let download_release_command = SonarrDownloadCommand::Episode {
guid: "guid".to_owned(),
indexer_id: 1,
+5 -5
View File
@@ -658,7 +658,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command = SonarrEditCommand::AllIndexerSettings {
maximum_size: Some(1),
minimum_age: Some(1),
@@ -705,7 +705,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_indexer_command = SonarrEditCommand::Indexer {
indexer_id: 1,
name: Some("Test".to_owned()),
@@ -757,7 +757,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_series_command = SonarrEditCommand::Series {
series_id: 1,
enable_monitoring: true,
@@ -805,7 +805,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_series_command = SonarrEditCommand::Series {
series_id: 1,
enable_monitoring: false,
@@ -853,7 +853,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_series_command = SonarrEditCommand::Series {
series_id: 1,
enable_monitoring: false,
+6 -6
View File
@@ -139,7 +139,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_all_indexer_settings_command = SonarrGetCommand::AllIndexerSettings;
let result = SonarrGetCommandHandler::with(
@@ -168,7 +168,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_episode_details_command = SonarrGetCommand::EpisodeDetails { episode_id: 1 };
let result =
@@ -191,7 +191,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_host_config_command = SonarrGetCommand::HostConfig;
let result =
@@ -214,7 +214,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_security_config_command = SonarrGetCommand::SecurityConfig;
let result =
@@ -240,7 +240,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_series_details_command = SonarrGetCommand::SeriesDetails { series_id: 1 };
let result =
@@ -263,7 +263,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_system_status_command = SonarrGetCommand::SystemStatus;
let result =
+8 -8
View File
@@ -313,7 +313,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let result = SonarrListCommandHandler::with(&app_arc, list_command, &mut mock_network)
.handle()
@@ -337,7 +337,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_episodes_command = SonarrListCommand::Episodes { series_id: 1 };
let result =
@@ -363,7 +363,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_episode_files_command = SonarrListCommand::EpisodeFiles { series_id: 1 };
let result =
@@ -389,7 +389,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_history_command = SonarrListCommand::History { events: 1000 };
let result =
@@ -415,7 +415,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_logs_command = SonarrListCommand::Logs {
events: 1000,
output_in_log_format: false,
@@ -443,7 +443,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_series_history_command = SonarrListCommand::SeriesHistory { series_id: 1 };
let result =
@@ -469,7 +469,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_episode_history_command = SonarrListCommand::EpisodeHistory { episode_id: 1 };
let result =
@@ -496,7 +496,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_season_history_command = SonarrListCommand::SeasonHistory {
series_id: 1,
season_number: 1,
@@ -138,7 +138,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let manual_episode_search_command = SonarrManualSearchCommand::Episode { episode_id: 1 };
let result = SonarrManualSearchCommandHandler::with(
@@ -168,7 +168,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let manual_season_search_command = SonarrManualSearchCommand::Season {
series_id: 1,
season_number: 1,
@@ -103,7 +103,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let result = SonarrRefreshCommandHandler::with(&app_arc, refresh_command, &mut mock_network)
.handle()
@@ -127,7 +127,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let refresh_series_command = SonarrRefreshCommand::Series { series_id: 1 };
let result =
+17 -17
View File
@@ -272,7 +272,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let claer_blocklist_command = SonarrCommand::ClearBlocklist;
let result = SonarrCliHandler::with(&app_arc, claer_blocklist_command, &mut mock_network)
@@ -297,7 +297,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let mark_history_item_as_failed_command =
SonarrCommand::MarkHistoryItemAsFailed { history_item_id: 1 };
@@ -327,7 +327,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let add_tag_command = SonarrCommand::Add(SonarrAddCommand::Tag {
name: expected_tag_name,
});
@@ -354,7 +354,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let delete_blocklist_item_command =
SonarrCommand::Delete(SonarrDeleteCommand::BlocklistItem {
blocklist_item_id: 1,
@@ -388,7 +388,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let download_series_release_command =
SonarrCommand::Download(SonarrDownloadCommand::Series {
guid: "1234".to_owned(),
@@ -442,7 +442,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let edit_all_indexer_settings_command =
SonarrCommand::Edit(SonarrEditCommand::AllIndexerSettings {
maximum_size: Some(1),
@@ -478,7 +478,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let manual_episode_search_command =
SonarrCommand::ManualSearch(SonarrManualSearchCommand::Episode { episode_id: 1 });
@@ -506,7 +506,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let manual_episode_search_command =
SonarrCommand::TriggerAutomaticSearch(SonarrTriggerAutomaticSearchCommand::Episode {
episode_id: 1,
@@ -532,7 +532,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_system_status_command = SonarrCommand::Get(SonarrGetCommand::SystemStatus);
let result = SonarrCliHandler::with(&app_arc, get_system_status_command, &mut mock_network)
@@ -554,7 +554,7 @@ mod tests {
Series::default(),
])))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let list_series_command = SonarrCommand::List(SonarrListCommand::Series);
let result = SonarrCliHandler::with(&app_arc, list_series_command, &mut mock_network)
@@ -579,7 +579,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let refresh_series_command =
SonarrCommand::Refresh(SonarrRefreshCommand::Series { series_id: 1 });
@@ -605,7 +605,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let search_new_series_command = SonarrCommand::SearchNewSeries {
query: "halo".to_owned(),
};
@@ -632,7 +632,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let start_task_command = SonarrCommand::StartTask {
task_name: SonarrTaskName::ApplicationUpdateCheck,
};
@@ -659,7 +659,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let test_indexer_command = SonarrCommand::TestIndexer { indexer_id: 1 };
let result = SonarrCliHandler::with(&app_arc, test_indexer_command, &mut mock_network)
@@ -681,7 +681,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let test_all_indexers_command = SonarrCommand::TestAllIndexers;
let result = SonarrCliHandler::with(&app_arc, test_all_indexers_command, &mut mock_network)
@@ -706,7 +706,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let toggle_episode_monitoring_command =
SonarrCommand::ToggleEpisodeMonitoring { episode_id: 1 };
@@ -737,7 +737,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let toggle_season_monitoring_command = SonarrCommand::ToggleSeasonMonitoring {
series_id: 1,
season_number: 1,
@@ -174,7 +174,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let trigger_automatic_series_search_command =
SonarrTriggerAutomaticSearchCommand::Series { series_id: 1 };
@@ -206,7 +206,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let trigger_automatic_season_search_command = SonarrTriggerAutomaticSearchCommand::Season {
series_id: 1,
season_number: 1,
@@ -238,7 +238,7 @@ mod tests {
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let app_arc = Arc::new(Mutex::new(App::test_default()));
let trigger_automatic_episode_search_command =
SonarrTriggerAutomaticSearchCommand::Episode { episode_id: 1 };