From 7f21e7102bfa0c36cdbd2ae934e4355ac708dcc1 Mon Sep 17 00:00:00 2001 From: just-an-engineer Date: Tue, 13 Aug 2024 11:22:45 -0400 Subject: [PATCH] Add test for server_shutdown from config --- src/config.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 2d4ceb4d8..5b339eff3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1615,7 +1615,6 @@ no_credentials = true #[test] fn test_port_config() { - // just set up a config file with just port, then have it read it in, and ensure port is defined in the struct const CONFIG_STR: &str = "port = 8080"; let file_config: FileConfig = toml::from_str(CONFIG_STR).expect("Is valid toml."); assert_eq!( @@ -1629,3 +1628,19 @@ fn test_port_config() { } ) } + +#[test] +fn test_shutdown_config() { + const CONFIG_STR: &str = "server_shutdown_timeout_ms = 10000"; + let file_config: FileConfig = toml::from_str(CONFIG_STR).expect("Is valid toml."); + assert_eq!( + file_config, + FileConfig { + cache: Default::default(), + dist: Default::default(), + server_startup_timeout_ms: None, + server_shutdown_timeout_ms: Some(10_000), + port: None, + } + ) +} \ No newline at end of file