Skip to content

Commit 554425c

Browse files
just-an-engineersylvestre
authored andcommitted
Add test for server_shutdown from config
1 parent 80193c7 commit 554425c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/config.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,6 @@ no_credentials = true
16151615

16161616
#[test]
16171617
fn test_port_config() {
1618-
// just set up a config file with just port, then have it read it in, and ensure port is defined in the struct
16191618
const CONFIG_STR: &str = "port = 8080";
16201619
let file_config: FileConfig = toml::from_str(CONFIG_STR).expect("Is valid toml.");
16211620
assert_eq!(
@@ -1629,3 +1628,19 @@ fn test_port_config() {
16291628
}
16301629
)
16311630
}
1631+
1632+
#[test]
1633+
fn test_shutdown_config() {
1634+
const CONFIG_STR: &str = "server_shutdown_timeout_ms = 10000";
1635+
let file_config: FileConfig = toml::from_str(CONFIG_STR).expect("Is valid toml.");
1636+
assert_eq!(
1637+
file_config,
1638+
FileConfig {
1639+
cache: Default::default(),
1640+
dist: Default::default(),
1641+
server_startup_timeout_ms: None,
1642+
server_shutdown_timeout_ms: Some(10_000),
1643+
port: None,
1644+
}
1645+
)
1646+
}

0 commit comments

Comments
 (0)