mirror of
https://git.zavage.net/Zavage-Software/smileyface.git
synced 2026-06-25 18:12:48 -06:00
Some checks failed
tests / test (3.10) (push) Has been cancelled
tests / test (3.11) (push) Has been cancelled
tests / test (3.12) (push) Has been cancelled
tests / test (3.13) (push) Has been cancelled
tests / test (3.8) (push) Has been cancelled
tests / test (3.9) (push) Has been cancelled
27 lines
800 B
Python
27 lines
800 B
Python
import os
|
|
|
|
from smileyface.settings import AppSettings
|
|
|
|
|
|
def _clear_smileyface_env(monkeypatch):
|
|
for key in list(os.environ):
|
|
if key.startswith("SMILEYFACE_"):
|
|
monkeypatch.delenv(key, raising=False)
|
|
|
|
|
|
def test_defaults(monkeypatch):
|
|
_clear_smileyface_env(monkeypatch)
|
|
settings = AppSettings(_env_file=None)
|
|
assert settings.sqlite_filename == "smiles.db"
|
|
assert settings.skip_validate is False
|
|
assert settings.project_dir == ""
|
|
|
|
|
|
def test_env_overrides(monkeypatch):
|
|
_clear_smileyface_env(monkeypatch)
|
|
monkeypatch.setenv("SMILEYFACE_PROJECT_DIR", "/srv/ut4")
|
|
monkeypatch.setenv("SMILEYFACE_SKIP_VALIDATE", "true")
|
|
settings = AppSettings(_env_file=None)
|
|
assert settings.project_dir == "/srv/ut4"
|
|
assert settings.skip_validate is True
|