fix(agent): raise ConfigError for malformed numeric env vars

This commit is contained in:
2026-08-23 16:48:31 -05:00
parent 46365468fe
commit 9a3492c01a
2 changed files with 22 additions and 2 deletions
+12
View File
@@ -51,3 +51,15 @@ def test_missing_required_var_names_the_var(missing):
env = {k: v for k, v in MINIMAL_ENV.items() if k != missing}
with pytest.raises(ConfigError, match=missing):
load_config(env)
def test_invalid_db_port_raises_config_error():
env = {**MINIMAL_ENV, "DB_PORT": "notanumber"}
with pytest.raises(ConfigError, match="DB_PORT"):
load_config(env)
def test_invalid_heartbeat_interval_raises_config_error():
env = {**MINIMAL_ENV, "HEARTBEAT_INTERVAL_MINUTES": "abc"}
with pytest.raises(ConfigError, match="HEARTBEAT_INTERVAL_MINUTES"):
load_config(env)