fix(agent): raise ConfigError for malformed numeric env vars
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user