from pathlib import Path

from pataniscai.config import Settings


def test_settings_parse_allowlist(monkeypatch, tmp_path: Path) -> None:
    monkeypatch.chdir(tmp_path)
    monkeypatch.setenv("PATANISCAI_TOKEN", "segredo")
    monkeypatch.setenv("PATANISCAI_ALLOWED_IPS", "127.0.0.1, 192.168.69.20")
    settings = Settings.from_env()
    assert settings.token == "segredo"
    assert settings.allowed_ips == frozenset({"127.0.0.1", "192.168.69.20"})

