app-MAIL-temp/tests/test_config.py
Son 372466ab06 do not use flask-sqlalchemy
- add __tablename__ for all models
- use sa and orm instead of db
- rollback all changes in tests
- remove session in @app.teardown_appcontext
2021-10-12 14:36:47 +02:00

14 lines
311 B
Python

import pytest
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")