Files
livef12rocks/tests/test_env_utils.py
Frank Schwenk c29186a227 test: add characterization tests for core modules
33 tests covering env/io helpers, config parsers, pipeline meta I/O,
worker inbox logic, and FastAPI smoke routes. No gmic/rembg subprocesses.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 17:12:09 +02:00

23 lines
634 B
Python

"""Tests for env_utils."""
from __future__ import annotations
from app.env_utils import env_bool
def test_env_bool_default(monkeypatch) -> None:
monkeypatch.delenv("TEST_FLAG", raising=False)
assert env_bool("TEST_FLAG", True) is True
assert env_bool("TEST_FLAG", False) is False
def test_env_bool_truthy(monkeypatch) -> None:
for value in ("1", "true", "TRUE", "yes", "on"):
monkeypatch.setenv("TEST_FLAG", value)
assert env_bool("TEST_FLAG", False) is True
def test_env_bool_falsy(monkeypatch) -> None:
monkeypatch.setenv("TEST_FLAG", "0")
assert env_bool("TEST_FLAG", True) is False