diff --git a/tests/test_config.py b/tests/test_config.py index ea20d23..9db1a95 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,10 +4,14 @@ from pydantic import ValidationError from app.config import Settings -def test_environment_prefix_and_validation(monkeypatch): - monkeypatch.setenv("MONITOR_CHECK_TIMEOUT_SECONDS", "2.5") - assert Settings().check_timeout_seconds == 2.5 +def test_environment_settings(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("MONITOR_PORT", "9000") + monkeypatch.setenv("MONITOR_MAX_REDIRECTS", "2") + settings = Settings() + assert settings.port == 9000 + assert settings.max_redirects == 2 + + +def test_invalid_settings_are_rejected() -> None: with pytest.raises(ValidationError): - Settings(check_timeout_seconds=0) - with pytest.raises(ValidationError): - Settings(max_redirects=99) + Settings(connect_timeout_seconds=0)