14 lines
416 B
Python
14 lines
416 B
Python
import pytest
|
|
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
|
|
with pytest.raises(ValidationError):
|
|
Settings(check_timeout_seconds=0)
|
|
with pytest.raises(ValidationError):
|
|
Settings(max_redirects=99)
|