Files
DMARC-Sentinel/tests/test_config.py
T
2026-05-16 12:05:36 -03:00

23 lines
592 B
Python

from pathlib import Path
import pytest
from app.config import load_settings
def test_default_config_requires_real_runtime_config(monkeypatch, tmp_path):
monkeypatch.delenv("DMARC_SENTINEL_CONFIG", raising=False)
monkeypatch.chdir(tmp_path)
with pytest.raises(FileNotFoundError, match="config/config.yml"):
load_settings()
def test_explicit_config_path_is_loaded(monkeypatch):
path = Path("tests/fixtures/config_test.yml")
monkeypatch.setenv("DMARC_SENTINEL_CONFIG", str(path))
settings = load_settings()
assert settings.inboxes[0].id == "tukutoi"