app-MAIL-temp/tests/test_config.py

14 lines
311 B
Python
Raw Permalink Normal View History

2021-03-05 17:26:42 +01:00
import pytest
2021-03-05 17:26:42 +01:00
from app.config import sl_getenv
def test_sl_getenv(monkeypatch):
monkeypatch.setenv("SL_KEY_1", '["domain_1"]')
assert sl_getenv("SL_KEY_1") == ["domain_1"]
assert sl_getenv("SL_KEY_2", default_factory=list) == []
with pytest.raises(TypeError):
sl_getenv("SL_KEY_3")