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>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""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
|
||||
Reference in New Issue
Block a user