feat(readarr): fetch the Readarr security config and expose it on the CLI

This commit is contained in:
Dark-Alex-17 committed 2026-08-20 16:15:34 -06:00
1 parent 1072585903
commit 97d67a6938
6 files changed
+117 -4

No files matched your search

+24 -1
View File
@@ -23,7 +23,7 @@ mod tests {
#[rstest]
fn test_get_commands_have_no_arg_requirements(
#[values("host-config", "system-status")] subcommand: &str,
#[values("host-config", "security-config", "system-status")] subcommand: &str,
) {
let result = Cli::command().try_get_matches_from(["managarr", "readarr", "get", subcommand]);
@@ -71,6 +71,29 @@ mod tests {
assert_ok!(&result);
}
#[tokio::test]
async fn test_handle_get_security_config_command() {
let mut mock_network = MockNetworkTrait::new();
mock_network
.expect_handle_network_event()
.with(eq::<NetworkEvent>(ReadarrEvent::GetSecurityConfig.into()))
.times(1)
.returning(|_| {
Ok(Serdeable::Readarr(ReadarrSerdeable::Value(
json!({"testResponse": "response"}),
)))
});
let app_arc = Arc::new(Mutex::new(App::test_default()));
let get_security_config_command = ReadarrGetCommand::SecurityConfig;
let result =
ReadarrGetCommandHandler::with(&app_arc, get_security_config_command, &mut mock_network)
.handle()
.await;
assert_ok!(&result);
}
#[tokio::test]
async fn test_handle_get_system_status_command() {
let mut mock_network = MockNetworkTrait::new();