feat(fase3): config-driven docs_dir + verdict_input on Project loader
This commit is contained in:
parent
8b64c7f8de
commit
c7c42eeb75
6 changed files with 44 additions and 2 deletions
|
|
@ -26,6 +26,18 @@ def test_every_project_well_formed(projects: tuple[Project, ...]) -> None:
|
|||
assert len(p.cost_items) >= 1
|
||||
|
||||
|
||||
def test_every_project_has_docs_dir_and_verdict_input(projects: tuple[Project, ...]) -> None:
|
||||
"""Step 2 (SC1 prep): docs_dir + verdict_input are config-driven per project. Each loaded
|
||||
Project exposes a docs_dir resolved to an existing bundled directory, and a verdict_input
|
||||
dict with exactly the decision + rationale keys. Removing the loader fields reddens this."""
|
||||
import os
|
||||
|
||||
for p in projects:
|
||||
assert p.docs_dir and os.path.isdir(p.docs_dir)
|
||||
assert set(p.verdict_input) == {"decision", "rationale"}
|
||||
assert p.verdict_input["decision"] and p.verdict_input["rationale"]
|
||||
|
||||
|
||||
def test_cost_item_total_is_quantity_times_unit_cost() -> None:
|
||||
item = CostItem(code="X", description="d", quantity=4.0, unit="m2", unit_cost=215.0)
|
||||
assert item.total_cost == pytest.approx(860.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue