test: Added in unit tests for TUI support for multiple custom named Servarrs
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user