From 6833e5a92840862bd2b4006d876860a6d4b38b98 Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Wed, 29 Jul 2026 22:53:38 +0800 Subject: [PATCH] test: validate unknown config warning with valid inputs --- synctv/src/cli/tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/synctv/src/cli/tests.rs b/synctv/src/cli/tests.rs index be484d65..168a6219 100644 --- a/synctv/src/cli/tests.rs +++ b/synctv/src/cli/tests.rs @@ -155,6 +155,8 @@ fn sample_config() -> crate::app_config::AppConfig { config.jwt.secret = "jwt-secret-123456789012345678901234".into(); config.security.opaque_server_setup_secret = "opaque-server-setup-secret-123456789012345678901234".into(); + config.security.credential_encryption_key = + "4444444444444444444444444444444444444444444444444444444444444444".into(); config.security.email_outbox_encryption_key = "5555555555555555555555555555555555555555555555555555555555555555".into(); config.security.totp_encryption_key = @@ -205,7 +207,17 @@ fn cli_parses_global_data_dir() { fn serve_config_context_warns_on_unknown_inputs() { let _env_lock = acquire_env_test_lock(); let _unknown_env = EnvVarGuard::set("SYNCTV_UNKNOWN_BOOT_FLAG", "1"); + let mut config_file = tempfile::Builder::new() + .suffix(".yaml") + .tempfile() + .expect("temporary config file should be created"); + serde_yaml::to_writer(&mut config_file, &sample_config()) + .expect("sample config should be serialized"); + config_file + .flush() + .expect("sample config should be written"); let context = CliConfigContext::new(GlobalConfigArgs { + config: Some(config_file.path().to_path_buf()), no_dotenv: true, ..GlobalConfigArgs::default() });