Files
QuantEngineByItz/tests/unit/test_validate_dotnet_migration_execution_plan_v1.py
T
kjh2064 ebbd42e4e0
CI Workflow Lint / validate-ci-workflow-lint (push) Failing after 14s
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 24s
Validators (Pushes and Pull Requests) / validate-core (push) Has been cancelled
feat(wbs): add execution plan validator and wiring
2026-07-13 00:01:07 +09:00

40 lines
1.3 KiB
Python

from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
def test_validate_dotnet_migration_execution_plan_passes() -> None:
root = Path(__file__).resolve().parents[2]
proc = subprocess.run(
[sys.executable, str(root / "tools" / "validate_dotnet_migration_execution_plan_v1.py")],
cwd=root,
capture_output=True,
text=True,
)
assert proc.returncode == 0, proc.stdout + proc.stderr
payload = json.loads(proc.stdout)
assert payload["gate"] == "PASS"
assert payload["formula_id"] == "WBS_10_DOTNET_MIGRATION_EXECUTION_PLAN_V1"
def test_validate_dotnet_migration_execution_plan_reports_missing_wp() -> None:
root = Path(__file__).resolve().parents[2]
temp = root / "Temp" / "test_wbs_10_execution_plan_bad.yaml"
temp.write_text(
"formula_id: WBS_10_DOTNET_MIGRATION_EXECUTION_PLAN_V1\nstatus: draft\nwork_packages: []\nexecution_order: []\n",
encoding="utf-8",
)
proc = subprocess.run(
[sys.executable, str(root / "tools" / "validate_dotnet_migration_execution_plan_v1.py"), "--plan", str(temp)],
cwd=root,
capture_output=True,
text=True,
)
assert proc.returncode != 0
payload = json.loads(proc.stdout)
assert payload["gate"] == "FAIL"
assert "WBS-10-WP1 missing" in payload["missing"]