refactor: Refactored all cli tests to use purpose-built assertions
This commit is contained in:
@@ -520,7 +520,7 @@ mod tests {
|
|||||||
"#;
|
"#;
|
||||||
let result: Result<ServarrConfig, _> = serde_yaml::from_str(yaml_data);
|
let result: Result<ServarrConfig, _> = serde_yaml::from_str(yaml_data);
|
||||||
|
|
||||||
let result = assert_err_as_result!(result);
|
assert_err!(&result);
|
||||||
let err = result.unwrap_err().to_string();
|
let err = result.unwrap_err().to_string();
|
||||||
assert_contains!(err, "invalid digit found in string");
|
assert_contains!(err, "invalid digit found in string");
|
||||||
}
|
}
|
||||||
|
|||||||
+180
-48
@@ -1,30 +1,69 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::app::context_clues::{
|
use crate::app::context_clues::{
|
||||||
ContextClueProvider, ServarrContextClueProvider, BARE_POPUP_CONTEXT_CLUES,
|
BARE_POPUP_CONTEXT_CLUES, BLOCKLIST_CONTEXT_CLUES, CONFIRMATION_PROMPT_CONTEXT_CLUES,
|
||||||
BLOCKLIST_CONTEXT_CLUES, CONFIRMATION_PROMPT_CONTEXT_CLUES, DOWNLOADS_CONTEXT_CLUES,
|
ContextClueProvider, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
||||||
INDEXERS_CONTEXT_CLUES, ROOT_FOLDERS_CONTEXT_CLUES, SERVARR_CONTEXT_CLUES,
|
ROOT_FOLDERS_CONTEXT_CLUES, SERVARR_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||||
SYSTEM_CONTEXT_CLUES,
|
ServarrContextClueProvider,
|
||||||
};
|
};
|
||||||
use crate::app::{key_binding::DEFAULT_KEYBINDINGS, App};
|
use crate::app::{App, key_binding::DEFAULT_KEYBINDINGS};
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::ActiveKeybindingBlock;
|
||||||
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::servarr_data::ActiveKeybindingBlock;
|
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_servarr_context_clues() {
|
fn test_servarr_context_clues() {
|
||||||
let mut servarr_context_clues_iter = SERVARR_CONTEXT_CLUES.iter();
|
let mut servarr_context_clues_iter = SERVARR_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.up, "scroll up"));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.down, "scroll down"));
|
servarr_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.left, "previous tab"));
|
&(DEFAULT_KEYBINDINGS.up, "scroll up")
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.right, "next tab"));
|
);
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.pg_up, DEFAULT_KEYBINDINGS.pg_up.desc));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.pg_down, DEFAULT_KEYBINDINGS.pg_down.desc));
|
servarr_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.next_servarr, DEFAULT_KEYBINDINGS.next_servarr.desc));
|
&(DEFAULT_KEYBINDINGS.down, "scroll down")
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.previous_servarr, DEFAULT_KEYBINDINGS.previous_servarr.desc));
|
);
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.quit, DEFAULT_KEYBINDINGS.quit.desc));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(servarr_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.help, DEFAULT_KEYBINDINGS.help.desc));
|
servarr_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.left, "previous tab")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.right, "next tab")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.pg_up, DEFAULT_KEYBINDINGS.pg_up.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.pg_down,
|
||||||
|
DEFAULT_KEYBINDINGS.pg_down.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.next_servarr,
|
||||||
|
DEFAULT_KEYBINDINGS.next_servarr.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.previous_servarr,
|
||||||
|
DEFAULT_KEYBINDINGS.previous_servarr.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.quit, DEFAULT_KEYBINDINGS.quit.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
servarr_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.help, DEFAULT_KEYBINDINGS.help.desc)
|
||||||
|
);
|
||||||
assert_none!(servarr_context_clues_iter.next());
|
assert_none!(servarr_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +71,10 @@ mod test {
|
|||||||
fn test_bare_popup_context_clues() {
|
fn test_bare_popup_context_clues() {
|
||||||
let mut bare_popup_context_clues_iter = BARE_POPUP_CONTEXT_CLUES.iter();
|
let mut bare_popup_context_clues_iter = BARE_POPUP_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(bare_popup_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc));
|
assert_some_eq_x!(
|
||||||
|
bare_popup_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc)
|
||||||
|
);
|
||||||
assert_none!(bare_popup_context_clues_iter.next());
|
assert_none!(bare_popup_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +82,21 @@ mod test {
|
|||||||
fn test_downloads_context_clues() {
|
fn test_downloads_context_clues() {
|
||||||
let mut downloads_context_clues_iter = DOWNLOADS_CONTEXT_CLUES.iter();
|
let mut downloads_context_clues_iter = DOWNLOADS_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(downloads_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.refresh, DEFAULT_KEYBINDINGS.refresh.desc));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(downloads_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc));
|
downloads_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(downloads_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.update, "update downloads"));
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.refresh,
|
||||||
|
DEFAULT_KEYBINDINGS.refresh.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
downloads_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
downloads_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.update, "update downloads")
|
||||||
|
);
|
||||||
assert_none!(downloads_context_clues_iter.next());
|
assert_none!(downloads_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,11 +104,29 @@ mod test {
|
|||||||
fn test_blocklist_context_clues() {
|
fn test_blocklist_context_clues() {
|
||||||
let mut blocklist_context_clues_iter = BLOCKLIST_CONTEXT_CLUES.iter();
|
let mut blocklist_context_clues_iter = BLOCKLIST_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(blocklist_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.refresh, DEFAULT_KEYBINDINGS.refresh.desc));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(blocklist_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.sort, DEFAULT_KEYBINDINGS.sort.desc));
|
blocklist_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(blocklist_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.submit, "details"));
|
&(
|
||||||
assert_some_eq_x!(blocklist_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc));
|
DEFAULT_KEYBINDINGS.refresh,
|
||||||
assert_some_eq_x!(blocklist_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.clear, "clear blocklist"));
|
DEFAULT_KEYBINDINGS.refresh.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
blocklist_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.sort, DEFAULT_KEYBINDINGS.sort.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
blocklist_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.submit, "details")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
blocklist_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
blocklist_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.clear, "clear blocklist")
|
||||||
|
);
|
||||||
assert_none!(blocklist_context_clues_iter.next());
|
assert_none!(blocklist_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,8 +134,14 @@ mod test {
|
|||||||
fn test_confirmation_prompt_context_clues() {
|
fn test_confirmation_prompt_context_clues() {
|
||||||
let mut confirmation_prompt_context_clues_iter = CONFIRMATION_PROMPT_CONTEXT_CLUES.iter();
|
let mut confirmation_prompt_context_clues_iter = CONFIRMATION_PROMPT_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(confirmation_prompt_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.confirm, "submit"));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(confirmation_prompt_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.esc, "cancel"));
|
confirmation_prompt_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.confirm, "submit")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
confirmation_prompt_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.esc, "cancel")
|
||||||
|
);
|
||||||
assert_none!(confirmation_prompt_context_clues_iter.next());
|
assert_none!(confirmation_prompt_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,9 +149,21 @@ mod test {
|
|||||||
fn test_root_folders_context_clues() {
|
fn test_root_folders_context_clues() {
|
||||||
let mut root_folders_context_clues_iter = ROOT_FOLDERS_CONTEXT_CLUES.iter();
|
let mut root_folders_context_clues_iter = ROOT_FOLDERS_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(root_folders_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.add, DEFAULT_KEYBINDINGS.add.desc));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(root_folders_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc));
|
root_folders_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(root_folders_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.refresh, DEFAULT_KEYBINDINGS.refresh.desc));
|
&(DEFAULT_KEYBINDINGS.add, DEFAULT_KEYBINDINGS.add.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
root_folders_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
root_folders_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.refresh,
|
||||||
|
DEFAULT_KEYBINDINGS.refresh.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
assert_none!(root_folders_context_clues_iter.next());
|
assert_none!(root_folders_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,12 +171,36 @@ mod test {
|
|||||||
fn test_indexers_context_clues() {
|
fn test_indexers_context_clues() {
|
||||||
let mut indexers_context_clues_iter = INDEXERS_CONTEXT_CLUES.iter();
|
let mut indexers_context_clues_iter = INDEXERS_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.submit, "edit indexer"));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.settings, DEFAULT_KEYBINDINGS.settings.desc));
|
indexers_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc));
|
&(DEFAULT_KEYBINDINGS.submit, "edit indexer")
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.test, "test indexer"));
|
);
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.test_all, "test all indexers"));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(indexers_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.refresh, DEFAULT_KEYBINDINGS.refresh.desc));
|
indexers_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.settings,
|
||||||
|
DEFAULT_KEYBINDINGS.settings.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
indexers_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.delete, DEFAULT_KEYBINDINGS.delete.desc)
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
indexers_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.test, "test indexer")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
indexers_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.test_all, "test all indexers")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
indexers_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.refresh,
|
||||||
|
DEFAULT_KEYBINDINGS.refresh.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
assert_none!(indexers_context_clues_iter.next());
|
assert_none!(indexers_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,11 +208,29 @@ mod test {
|
|||||||
fn test_system_context_clues() {
|
fn test_system_context_clues() {
|
||||||
let mut system_context_clues_iter = SYSTEM_CONTEXT_CLUES.iter();
|
let mut system_context_clues_iter = SYSTEM_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
assert_some_eq_x!(system_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.tasks, "open tasks"));
|
assert_some_eq_x!(
|
||||||
assert_some_eq_x!(system_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.events, "open events"));
|
system_context_clues_iter.next(),
|
||||||
assert_some_eq_x!(system_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.logs, "open logs"));
|
&(DEFAULT_KEYBINDINGS.tasks, "open tasks")
|
||||||
assert_some_eq_x!(system_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.update, "open updates"));
|
);
|
||||||
assert_some_eq_x!(system_context_clues_iter.next(), &(DEFAULT_KEYBINDINGS.refresh, DEFAULT_KEYBINDINGS.refresh.desc));
|
assert_some_eq_x!(
|
||||||
|
system_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.events, "open events")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
system_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.logs, "open logs")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
system_context_clues_iter.next(),
|
||||||
|
&(DEFAULT_KEYBINDINGS.update, "open updates")
|
||||||
|
);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
system_context_clues_iter.next(),
|
||||||
|
&(
|
||||||
|
DEFAULT_KEYBINDINGS.refresh,
|
||||||
|
DEFAULT_KEYBINDINGS.refresh.desc
|
||||||
|
)
|
||||||
|
);
|
||||||
assert_none!(system_context_clues_iter.next());
|
assert_none!(system_context_clues_iter.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +242,7 @@ mod test {
|
|||||||
let context_clues = ServarrContextClueProvider::get_context_clues(&mut app);
|
let context_clues = ServarrContextClueProvider::get_context_clues(&mut app);
|
||||||
|
|
||||||
assert_some_eq_x!(
|
assert_some_eq_x!(
|
||||||
context_clues,
|
context_clues,
|
||||||
&crate::app::radarr::radarr_context_clues::SYSTEM_TASKS_CONTEXT_CLUES,
|
&crate::app::radarr::radarr_context_clues::SYSTEM_TASKS_CONTEXT_CLUES,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -123,7 +255,7 @@ mod test {
|
|||||||
let context_clues = ServarrContextClueProvider::get_context_clues(&mut app);
|
let context_clues = ServarrContextClueProvider::get_context_clues(&mut app);
|
||||||
|
|
||||||
assert_some_eq_x!(
|
assert_some_eq_x!(
|
||||||
context_clues,
|
context_clues,
|
||||||
&crate::app::sonarr::sonarr_context_clues::SYSTEM_TASKS_CONTEXT_CLUES,
|
&crate::app::sonarr::sonarr_context_clues::SYSTEM_TASKS_CONTEXT_CLUES,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::app::context_clues::{
|
use crate::app::App;
|
||||||
ContextClue, ContextClueProvider, BARE_POPUP_CONTEXT_CLUES, BLOCKLIST_CONTEXT_CLUES,
|
use crate::app::context_clues::{
|
||||||
CONFIRMATION_PROMPT_CONTEXT_CLUES, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
BARE_POPUP_CONTEXT_CLUES, BLOCKLIST_CONTEXT_CLUES, CONFIRMATION_PROMPT_CONTEXT_CLUES,
|
||||||
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
ContextClue, ContextClueProvider, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
||||||
};
|
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
};
|
||||||
use crate::app::radarr::radarr_context_clues::{
|
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||||
RadarrContextClueProvider, ADD_MOVIE_SEARCH_RESULTS_CONTEXT_CLUES, COLLECTIONS_CONTEXT_CLUES,
|
use crate::app::radarr::radarr_context_clues::{
|
||||||
COLLECTION_DETAILS_CONTEXT_CLUES, LIBRARY_CONTEXT_CLUES, MANUAL_MOVIE_SEARCH_CONTEXT_CLUES,
|
ADD_MOVIE_SEARCH_RESULTS_CONTEXT_CLUES, COLLECTION_DETAILS_CONTEXT_CLUES,
|
||||||
MOVIE_DETAILS_CONTEXT_CLUES, SYSTEM_TASKS_CONTEXT_CLUES,
|
COLLECTIONS_CONTEXT_CLUES, LIBRARY_CONTEXT_CLUES, MANUAL_MOVIE_SEARCH_CONTEXT_CLUES,
|
||||||
};
|
MOVIE_DETAILS_CONTEXT_CLUES, RadarrContextClueProvider, SYSTEM_TASKS_CONTEXT_CLUES,
|
||||||
use crate::app::App;
|
};
|
||||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
||||||
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_library_context_clues() {
|
fn test_library_context_clues() {
|
||||||
let mut library_context_clues_iter = LIBRARY_CONTEXT_CLUES.iter();
|
let mut library_context_clues_iter = LIBRARY_CONTEXT_CLUES.iter();
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::app::context_clues::{
|
use crate::app::context_clues::{
|
||||||
ContextClue, ContextClueProvider, BARE_POPUP_CONTEXT_CLUES, BLOCKLIST_CONTEXT_CLUES,
|
BARE_POPUP_CONTEXT_CLUES, BLOCKLIST_CONTEXT_CLUES, CONFIRMATION_PROMPT_CONTEXT_CLUES,
|
||||||
CONFIRMATION_PROMPT_CONTEXT_CLUES, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
ContextClue, ContextClueProvider, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
||||||
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||||
};
|
};
|
||||||
use crate::app::sonarr::sonarr_context_clues::{
|
use crate::app::sonarr::sonarr_context_clues::{
|
||||||
SonarrContextClueProvider, SELECTABLE_EPISODE_DETAILS_CONTEXT_CLUES,
|
SELECTABLE_EPISODE_DETAILS_CONTEXT_CLUES, SonarrContextClueProvider,
|
||||||
};
|
};
|
||||||
use crate::app::{
|
use crate::app::{
|
||||||
|
App,
|
||||||
key_binding::DEFAULT_KEYBINDINGS,
|
key_binding::DEFAULT_KEYBINDINGS,
|
||||||
sonarr::sonarr_context_clues::{
|
sonarr::sonarr_context_clues::{
|
||||||
ADD_SERIES_SEARCH_RESULTS_CONTEXT_CLUES, EPISODE_DETAILS_CONTEXT_CLUES,
|
ADD_SERIES_SEARCH_RESULTS_CONTEXT_CLUES, EPISODE_DETAILS_CONTEXT_CLUES,
|
||||||
@@ -17,7 +18,6 @@ mod tests {
|
|||||||
SEASON_HISTORY_CONTEXT_CLUES, SERIES_CONTEXT_CLUES, SERIES_DETAILS_CONTEXT_CLUES,
|
SEASON_HISTORY_CONTEXT_CLUES, SERIES_CONTEXT_CLUES, SERIES_DETAILS_CONTEXT_CLUES,
|
||||||
SERIES_HISTORY_CONTEXT_CLUES, SYSTEM_TASKS_CONTEXT_CLUES,
|
SERIES_HISTORY_CONTEXT_CLUES, SYSTEM_TASKS_CONTEXT_CLUES,
|
||||||
},
|
},
|
||||||
App,
|
|
||||||
};
|
};
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::servarr_data::sonarr::modals::{EpisodeDetailsModal, SeasonDetailsModal};
|
use crate::models::servarr_data::sonarr::modals::{EpisodeDetailsModal, SeasonDetailsModal};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ mod tests {
|
|||||||
fn test_servarr_subcommand_requires_subcommand(#[values("radarr", "sonarr")] subcommand: &str) {
|
fn test_servarr_subcommand_requires_subcommand(#[values("radarr", "sonarr")] subcommand: &str) {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", subcommand]);
|
let result = Cli::command().try_get_matches_from(["managarr", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
|
ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
|
||||||
@@ -45,21 +45,21 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "all-indexer-settings"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "all-indexer-settings"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sonarr_subcommand_delegates_to_sonarr() {
|
fn test_sonarr_subcommand_delegates_to_sonarr() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "series"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_completions_requires_argument() {
|
fn test_completions_requires_argument() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "completions"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "completions"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
|
ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
|
||||||
@@ -70,7 +70,7 @@ mod tests {
|
|||||||
fn test_completions_invalid_argument() {
|
fn test_completions_invalid_argument() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "completions", "test"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "completions", "test"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ mod tests {
|
|||||||
fn test_completions_satisfied_with_argument() {
|
fn test_completions_satisfied_with_argument() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "completions", "bash"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "completions", "bash"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
@@ -141,7 +141,7 @@ mod tests {
|
|||||||
|
|
||||||
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
|
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -172,6 +172,6 @@ mod tests {
|
|||||||
|
|
||||||
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
|
let result = handle_command(&app_arc, clear_blocklist_command, &mut mock_network).await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ mod tests {
|
|||||||
fn test_add_movie_requires_arguments() {
|
fn test_add_movie_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "add", "movie"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "add", "movie"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -52,7 +52,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -72,7 +72,7 @@ mod tests {
|
|||||||
"/test",
|
"/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -92,7 +92,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -117,7 +117,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -156,7 +156,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,10 +207,11 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type")
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -243,10 +244,11 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type")
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -285,10 +287,11 @@ mod tests {
|
|||||||
"--no-search-for-movie",
|
"--no-search-for-movie",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type")
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -296,7 +299,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "add", "root-folder"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "add", "root-folder"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -318,18 +321,19 @@ mod tests {
|
|||||||
"/nfs/test",
|
"/nfs/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type")
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_tag_requires_arguments() {
|
fn test_add_tag_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "add", "tag"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "add", "tag"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -344,11 +348,12 @@ mod tests {
|
|||||||
|
|
||||||
let result = Cli::try_parse_from(["managarr", "radarr", "add", "tag", "--name", "test"]);
|
let result = Cli::try_parse_from(["managarr", "radarr", "add", "tag", "--name", "test"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type")
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +421,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -447,7 +452,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -474,7 +479,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "blocklist-item"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "blocklist-item"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -52,12 +52,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -65,7 +66,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "download"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "download"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -85,19 +86,20 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_indexer_requires_arguments() {
|
fn test_delete_indexer_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -117,19 +119,20 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_movie_requires_arguments() {
|
fn test_delete_movie_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "movie"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "movie"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -147,12 +150,13 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::try_parse_from(["managarr", "radarr", "delete", "movie", "--movie-id", "1"]);
|
Cli::try_parse_from(["managarr", "radarr", "delete", "movie", "--movie-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -174,12 +178,13 @@ mod tests {
|
|||||||
"--add-list-exclusion",
|
"--add-list-exclusion",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -187,7 +192,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "root-folder"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "root-folder"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -207,19 +212,20 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_tag_requires_arguments() {
|
fn test_delete_tag_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "tag"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "delete", "tag"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -232,12 +238,13 @@ mod tests {
|
|||||||
|
|
||||||
let result = Cli::try_parse_from(["managarr", "radarr", "delete", "tag", "--tag-id", "1"]);
|
let result = Cli::try_parse_from(["managarr", "radarr", "delete", "tag", "--tag-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Radarr(RadarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +296,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -315,7 +322,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -341,7 +348,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -375,7 +382,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -401,7 +408,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -427,7 +434,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "all-indexer-settings"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "all-indexer-settings"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -60,7 +60,7 @@ mod tests {
|
|||||||
"--disable-allow-hardcoded-subs",
|
"--disable-allow-hardcoded-subs",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ mod tests {
|
|||||||
"--disable-prefer-indexer-flags",
|
"--disable-prefer-indexer-flags",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,11 +126,12 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -168,11 +169,12 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -180,7 +182,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "collection"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "collection"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -198,7 +200,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -218,7 +220,7 @@ mod tests {
|
|||||||
"--disable-monitoring",
|
"--disable-monitoring",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ mod tests {
|
|||||||
"--disable-search-on-add",
|
"--disable-search-on-add",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +254,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +272,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,11 +300,12 @@ mod tests {
|
|||||||
"/test",
|
"/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -334,18 +337,19 @@ mod tests {
|
|||||||
"--search-on-add",
|
"--search-on-add",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_edit_indexer_requires_arguments() {
|
fn test_edit_indexer_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -363,7 +367,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -383,7 +387,7 @@ mod tests {
|
|||||||
"--disable-rss",
|
"--disable-rss",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +404,7 @@ mod tests {
|
|||||||
"--disable-automatic-search",
|
"--disable-automatic-search",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +421,7 @@ mod tests {
|
|||||||
"--disable-interactive-search",
|
"--disable-interactive-search",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,7 +439,7 @@ mod tests {
|
|||||||
"--clear-tags",
|
"--clear-tags",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +457,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,11 +491,12 @@ mod tests {
|
|||||||
"Test",
|
"Test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -526,11 +531,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -578,18 +584,19 @@ mod tests {
|
|||||||
"25",
|
"25",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_edit_movie_requires_arguments() {
|
fn test_edit_movie_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "movie"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "edit", "movie"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -607,7 +614,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -627,7 +634,7 @@ mod tests {
|
|||||||
"--disable-monitoring",
|
"--disable-monitoring",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,7 +652,7 @@ mod tests {
|
|||||||
"--clear-tags",
|
"--clear-tags",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,7 +676,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,7 +693,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,11 +721,12 @@ mod tests {
|
|||||||
"/nfs/test",
|
"/nfs/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -747,11 +755,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -787,11 +796,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -887,7 +897,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -958,7 +968,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1030,7 +1040,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1072,7 +1082,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1114,7 +1124,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1156,7 +1166,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1210,7 +1220,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1264,7 +1274,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1318,7 +1328,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1361,7 +1371,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1404,7 +1414,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -1447,7 +1457,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "all-indexer-settings"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "all-indexer-settings"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -35,7 +35,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "host-config"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "host-config"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -43,7 +43,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "movie-details"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "movie-details"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -61,7 +61,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -69,7 +69,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "movie-history"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "movie-history"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -87,7 +87,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -95,7 +95,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "security-config"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "security-config"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -103,7 +103,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "system-status"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "get", "system-status"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -172,7 +172,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -198,7 +198,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -224,7 +224,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -247,7 +247,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -270,7 +270,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ mod tests {
|
|||||||
) {
|
) {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "list", subcommand]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "list", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -51,7 +51,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "movie-credits"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "movie-credits"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -63,7 +63,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "downloads", "--count"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "downloads", "--count"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "logs", "--events"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "list", "logs", "--events"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,11 +88,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::List(credits_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::List(credits_command))) = result.unwrap().command
|
||||||
assert_eq!(credits_command, expected_args);
|
else {
|
||||||
}
|
panic!("Unexpected command type");
|
||||||
|
};
|
||||||
|
assert_eq!(credits_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -100,11 +102,13 @@ mod tests {
|
|||||||
let expected_args = RadarrListCommand::Downloads { count: 500 };
|
let expected_args = RadarrListCommand::Downloads { count: 500 };
|
||||||
let result = Cli::try_parse_from(["managarr", "radarr", "list", "downloads"]);
|
let result = Cli::try_parse_from(["managarr", "radarr", "list", "downloads"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::List(refresh_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::List(refresh_command))) = result.unwrap().command
|
||||||
assert_eq!(refresh_command, expected_args);
|
else {
|
||||||
}
|
panic!("Unexpected command type");
|
||||||
|
};
|
||||||
|
assert_eq!(refresh_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -115,11 +119,13 @@ mod tests {
|
|||||||
};
|
};
|
||||||
let result = Cli::try_parse_from(["managarr", "radarr", "list", "logs"]);
|
let result = Cli::try_parse_from(["managarr", "radarr", "list", "logs"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::List(refresh_command))) = result.unwrap().command {
|
let Some(Command::Radarr(RadarrCommand::List(refresh_command))) = result.unwrap().command
|
||||||
assert_eq!(refresh_command, expected_args);
|
else {
|
||||||
}
|
panic!("Unexpected command type");
|
||||||
|
};
|
||||||
|
assert_eq!(refresh_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +178,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -198,7 +204,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -224,7 +230,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -252,7 +258,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ mod tests {
|
|||||||
) {
|
) {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", subcommand]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -43,7 +43,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -62,7 +62,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -81,7 +81,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -102,14 +102,14 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_manual_search_requires_movie_id() {
|
fn test_manual_search_requires_movie_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "manual-search"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "manual-search"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -126,14 +126,14 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_search_new_movie_requires_query() {
|
fn test_search_new_movie_requires_query() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "search-new-movie"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "search-new-movie"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -150,14 +150,14 @@ mod tests {
|
|||||||
"halo",
|
"halo",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_start_task_requires_task_name() {
|
fn test_start_task_requires_task_name() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "start-task"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "start-task"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -174,7 +174,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,14 +188,14 @@ mod tests {
|
|||||||
"application-check-update",
|
"application-check-update",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_test_indexer_requires_indexer_id() {
|
fn test_test_indexer_requires_indexer_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "test-indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "test-indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -212,7 +212,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -220,7 +220,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "toggle-movie-monitoring"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "toggle-movie-monitoring"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -237,7 +237,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -245,7 +245,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "trigger-automatic-search"]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "trigger-automatic-search"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -262,7 +262,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -357,7 +357,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -382,7 +382,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -409,7 +409,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -436,7 +436,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -461,7 +461,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -483,7 +483,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -509,7 +509,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -538,7 +538,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -565,7 +565,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -594,7 +594,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -666,7 +666,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -695,7 +695,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -721,7 +721,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -747,7 +747,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "radarr", "refresh", subcommand]);
|
Cli::command().try_get_matches_from(["managarr", "radarr", "refresh", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_refresh_movie_requires_movie_id() {
|
fn test_refresh_movie_requires_movie_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "refresh", "movie"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "radarr", "refresh", "movie"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -51,13 +51,13 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::try_parse_from(["managarr", "radarr", "refresh", "movie", "--movie-id", "1"]);
|
Cli::try_parse_from(["managarr", "radarr", "refresh", "movie", "--movie-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Radarr(RadarrCommand::Refresh(refresh_command))) =
|
let Some(Command::Radarr(RadarrCommand::Refresh(refresh_command))) = result.unwrap().command
|
||||||
result.unwrap().command
|
else {
|
||||||
{
|
panic!("Unexpected command type");
|
||||||
assert_eq!(refresh_command, expected_args);
|
};
|
||||||
}
|
assert_eq!(refresh_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -128,7 +128,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "root-folder"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "root-folder"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -56,18 +56,19 @@ mod tests {
|
|||||||
"/nfs/test",
|
"/nfs/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_series_requires_arguments() {
|
fn test_add_series_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "series"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -91,7 +92,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -115,7 +116,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -139,7 +140,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -163,7 +164,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -187,7 +188,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -216,7 +217,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -263,7 +264,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +289,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,10 +326,11 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -368,10 +370,11 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -418,17 +421,18 @@ mod tests {
|
|||||||
"--no-search-for-series",
|
"--no-search-for-series",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_add_tag_requires_arguments() {
|
fn test_add_tag_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "tag"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "add", "tag"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -443,11 +447,12 @@ mod tests {
|
|||||||
|
|
||||||
let result = Cli::try_parse_from(["managarr", "sonarr", "add", "tag", "--name", "test"]);
|
let result = Cli::try_parse_from(["managarr", "sonarr", "add", "tag", "--name", "test"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Add(add_command))) = result.unwrap().command else {
|
||||||
assert_eq!(add_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(add_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +506,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -554,7 +559,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -581,7 +586,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "blocklist-item"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "blocklist-item"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -52,12 +52,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -65,7 +66,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "download"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "download"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -85,12 +86,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -98,7 +100,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "episode-file"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "episode-file"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -118,19 +120,20 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_indexer_requires_arguments() {
|
fn test_delete_indexer_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -150,12 +153,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -163,7 +167,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "root-folder"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "root-folder"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -183,19 +187,20 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_series_requires_arguments() {
|
fn test_delete_series_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "series"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -213,12 +218,13 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::try_parse_from(["managarr", "sonarr", "delete", "series", "--series-id", "1"]);
|
Cli::try_parse_from(["managarr", "sonarr", "delete", "series", "--series-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -240,19 +246,20 @@ mod tests {
|
|||||||
"--add-list-exclusion",
|
"--add-list-exclusion",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delete_tag_requires_arguments() {
|
fn test_delete_tag_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "tag"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "delete", "tag"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -265,12 +272,13 @@ mod tests {
|
|||||||
|
|
||||||
let result = Cli::try_parse_from(["managarr", "sonarr", "delete", "tag", "--tag-id", "1"]);
|
let result = Cli::try_parse_from(["managarr", "sonarr", "delete", "tag", "--tag-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::Delete(delete_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(delete_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(delete_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +330,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -348,7 +356,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -374,7 +382,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -400,7 +408,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -426,7 +434,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -460,7 +468,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -486,7 +494,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -61,7 +61,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -81,7 +81,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -103,7 +103,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -121,7 +121,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -143,7 +143,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -165,7 +165,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -187,7 +187,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -211,7 +211,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -227,7 +227,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -247,7 +247,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -267,7 +267,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -289,7 +289,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -382,7 +382,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -417,7 +417,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "all-indexer-settings"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "all-indexer-settings"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -57,7 +57,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,11 +78,12 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -108,18 +109,19 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_edit_indexer_requires_arguments() {
|
fn test_edit_indexer_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -137,7 +139,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -157,7 +159,7 @@ mod tests {
|
|||||||
"--disable-rss",
|
"--disable-rss",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +176,7 @@ mod tests {
|
|||||||
"--disable-automatic-search",
|
"--disable-automatic-search",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +193,7 @@ mod tests {
|
|||||||
"--disable-interactive-search",
|
"--disable-interactive-search",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +211,7 @@ mod tests {
|
|||||||
"--clear-tags",
|
"--clear-tags",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +229,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,11 +263,12 @@ mod tests {
|
|||||||
"Test",
|
"Test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -300,11 +303,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -352,18 +356,19 @@ mod tests {
|
|||||||
"25",
|
"25",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_edit_series_requires_arguments() {
|
fn test_edit_series_requires_arguments() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "edit", "series"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -381,7 +386,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -401,7 +406,7 @@ mod tests {
|
|||||||
"--disable-monitoring",
|
"--disable-monitoring",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +423,7 @@ mod tests {
|
|||||||
"--disable-season-folders",
|
"--disable-season-folders",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,7 +441,7 @@ mod tests {
|
|||||||
"--clear-tags",
|
"--clear-tags",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,7 +466,7 @@ mod tests {
|
|||||||
flag,
|
flag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +483,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -509,11 +514,12 @@ mod tests {
|
|||||||
"/nfs/test",
|
"/nfs/test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -545,11 +551,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -591,11 +598,12 @@ mod tests {
|
|||||||
"2",
|
"2",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::Edit(edit_command))) = result.unwrap().command else {
|
||||||
assert_eq!(edit_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(edit_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,7 +682,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -728,7 +736,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -776,7 +784,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -824,7 +832,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -872,7 +880,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "all-indexer-settings"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "all-indexer-settings"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -36,7 +36,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "system-status"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "system-status"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -44,7 +44,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "episode-details"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "episode-details"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -62,7 +62,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -70,7 +70,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "host-config"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "host-config"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -78,7 +78,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "security-config"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "security-config"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -86,7 +86,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "series-details"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "get", "series-details"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -104,7 +104,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -176,7 +176,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -199,7 +199,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -222,7 +222,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -248,7 +248,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -271,7 +271,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ mod tests {
|
|||||||
) {
|
) {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", subcommand]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_list_episodes_requires_series_id() {
|
fn test_list_episodes_requires_series_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episodes"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episodes"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -61,7 +61,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episode-files"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episode-files"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -73,7 +73,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episode-history"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "episode-history"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -92,13 +92,14 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(episode_history_command))) =
|
let Some(Command::Sonarr(SonarrCommand::List(episode_history_command))) =
|
||||||
result.unwrap().command
|
result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(episode_history_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(episode_history_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -106,7 +107,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "downloads", "--count"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "downloads", "--count"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,12 +116,13 @@ mod tests {
|
|||||||
let expected_args = SonarrListCommand::Downloads { count: 500 };
|
let expected_args = SonarrListCommand::Downloads { count: 500 };
|
||||||
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "downloads"]);
|
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "downloads"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(downloads_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::List(downloads_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(downloads_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(downloads_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -128,7 +130,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "history", "--events"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "history", "--events"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,11 +139,13 @@ mod tests {
|
|||||||
let expected_args = SonarrListCommand::History { events: 500 };
|
let expected_args = SonarrListCommand::History { events: 500 };
|
||||||
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "history"]);
|
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "history"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(history_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::List(history_command))) = result.unwrap().command
|
||||||
assert_eq!(history_command, expected_args);
|
else {
|
||||||
}
|
panic!("Unexpected command type");
|
||||||
|
};
|
||||||
|
assert_eq!(history_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -149,7 +153,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "logs", "--events"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "logs", "--events"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,11 +165,12 @@ mod tests {
|
|||||||
};
|
};
|
||||||
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "logs"]);
|
let result = Cli::try_parse_from(["managarr", "sonarr", "list", "logs"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(logs_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::List(logs_command))) = result.unwrap().command else {
|
||||||
assert_eq!(logs_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(logs_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -174,12 +179,13 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::try_parse_from(["managarr", "sonarr", "list", "episodes", "--series-id", "1"]);
|
Cli::try_parse_from(["managarr", "sonarr", "list", "episodes", "--series-id", "1"]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(episodes_command))) = result.unwrap().command
|
let Some(Command::Sonarr(SonarrCommand::List(episodes_command))) = result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(episodes_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(episodes_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -194,13 +200,14 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(episode_files_command))) =
|
let Some(Command::Sonarr(SonarrCommand::List(episode_files_command))) =
|
||||||
result.unwrap().command
|
result.unwrap().command
|
||||||
{
|
else {
|
||||||
assert_eq!(episode_files_command, expected_args);
|
panic!("Unexpected command type");
|
||||||
}
|
};
|
||||||
|
assert_eq!(episode_files_command, expected_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -214,7 +221,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -232,7 +239,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -252,7 +259,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -260,7 +267,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "series-history"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "list", "series-history"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -279,11 +286,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::List(series_command))) = result.unwrap().command {
|
let Some(Command::Sonarr(SonarrCommand::List(series_command))) = result.unwrap().command
|
||||||
assert_eq!(series_command, expected_args);
|
else {
|
||||||
}
|
panic!("Unexpected command type");
|
||||||
|
};
|
||||||
|
assert_eq!(series_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +348,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -365,7 +374,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -391,7 +400,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -417,7 +426,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -443,7 +452,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -471,7 +480,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -497,7 +506,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -523,7 +532,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -553,7 +562,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -54,7 +54,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -74,7 +74,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -82,7 +82,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "manual-search", "episode"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "manual-search", "episode"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -100,7 +100,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -182,7 +182,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "refresh", subcommand]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "refresh", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_refresh_series_requires_series_id() {
|
fn test_refresh_series_requires_series_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "refresh", "series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "refresh", "series"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -57,13 +57,13 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
|
|
||||||
if let Some(Command::Sonarr(SonarrCommand::Refresh(refresh_command))) =
|
let Some(Command::Sonarr(SonarrCommand::Refresh(refresh_command))) = result.unwrap().command
|
||||||
result.unwrap().command
|
else {
|
||||||
{
|
panic!("Unexpected command type");
|
||||||
assert_eq!(refresh_command, expected_args);
|
};
|
||||||
}
|
assert_eq!(refresh_command, expected_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -135,7 +135,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ mod tests {
|
|||||||
) {
|
) {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", subcommand]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", subcommand]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -37,7 +37,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "mark-history-item-as-failed"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "mark-history-item-as-failed"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -54,14 +54,14 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_search_new_series_requires_query() {
|
fn test_search_new_series_requires_query() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "search-new-series"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "search-new-series"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -78,14 +78,14 @@ mod tests {
|
|||||||
"halo",
|
"halo",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_start_task_requires_task_name() {
|
fn test_start_task_requires_task_name() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "start-task"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "start-task"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -102,7 +102,7 @@ mod tests {
|
|||||||
"test",
|
"test",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,14 +116,14 @@ mod tests {
|
|||||||
"application-update-check",
|
"application-update-check",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_test_indexer_requires_indexer_id() {
|
fn test_test_indexer_requires_indexer_id() {
|
||||||
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "test-indexer"]);
|
let result = Cli::command().try_get_matches_from(["managarr", "sonarr", "test-indexer"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -140,7 +140,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -148,7 +148,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "toggle-episode-monitoring"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "toggle-episode-monitoring"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -165,7 +165,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -178,7 +178,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -195,7 +195,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -214,7 +214,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -222,7 +222,7 @@ mod tests {
|
|||||||
let result =
|
let result =
|
||||||
Cli::command().try_get_matches_from(["managarr", "sonarr", "toggle-series-monitoring"]);
|
Cli::command().try_get_matches_from(["managarr", "sonarr", "toggle-series-monitoring"]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -239,7 +239,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -334,7 +334,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -361,7 +361,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -390,7 +390,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -426,7 +426,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -484,7 +484,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -512,7 +512,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -542,7 +542,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -564,7 +564,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -586,7 +586,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -612,7 +612,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -639,7 +639,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -666,7 +666,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -691,7 +691,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -713,7 +713,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -743,7 +743,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -776,7 +776,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -805,7 +805,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ mod tests {
|
|||||||
"series",
|
"series",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -54,7 +54,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -68,7 +68,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -86,7 +86,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -106,7 +106,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -118,7 +118,7 @@ mod tests {
|
|||||||
"episode",
|
"episode",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_err());
|
assert_err!(&result);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.unwrap_err().kind(),
|
result.unwrap_err().kind(),
|
||||||
ErrorKind::MissingRequiredArgument
|
ErrorKind::MissingRequiredArgument
|
||||||
@@ -136,7 +136,7 @@ mod tests {
|
|||||||
"1",
|
"1",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -220,7 +220,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -250,7 +250,7 @@ mod tests {
|
|||||||
.handle()
|
.handle()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(result.is_ok());
|
assert_ok!(&result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user