Skip to content

Commit

Permalink
Add test for server_shutdown from config
Browse files Browse the repository at this point in the history
  • Loading branch information
just-an-engineer authored and just-an-engineer committed Aug 13, 2024
1 parent e8061b5 commit 7f21e71
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand All @@ -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,
}
)
}

0 comments on commit 7f21e71

Please sign in to comment.