27 lines
822 B
Python
27 lines
822 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from app.cli.seed_settings import load_seed
|
|
from app.services import REQUIRED_SETTINGS
|
|
|
|
|
|
def test_production_like_seed_contains_all_mandatory_settings() -> None:
|
|
path = Path(__file__).resolve().parents[3] / "deployment/app-settings.production-like.yaml"
|
|
rows = load_seed(path)
|
|
|
|
assert REQUIRED_SETTINGS <= {row["setting_key"] for row in rows}
|
|
assert all(row["record_status"] == "A" for row in rows)
|
|
|
|
|
|
def test_seed_rejects_invalid_typed_value(tmp_path: Path) -> None:
|
|
path = tmp_path / "settings.yaml"
|
|
path.write_text(
|
|
"schema_version: 1\nsettings:\n"
|
|
" bad.integer: {type: integer, value: nope, public: false}\n",
|
|
encoding="utf-8",
|
|
)
|
|
|
|
with pytest.raises(ValueError, match="integer value expected"):
|
|
load_seed(path)
|