smileyface/tests/test_settings.py
Mathew Sir Guest the best 0c8fa30145
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
build: cleanup for new selenium and guards
2026-05-31 01:56:37 -06:00

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