Harden high-rigor Jyotish timing workflow
This commit is contained in:
@@ -26,6 +26,7 @@ def test_vedastro_method_catalog_sync_schema_is_declared() -> None:
|
||||
assert report["scope"] == "official_vedastro_method_catalog"
|
||||
assert "sync_tags" in report["operations"]
|
||||
assert "write_snapshot" in report["operations"]
|
||||
assert "sync_python_capabilities" in report["operations"]
|
||||
|
||||
|
||||
def test_vedastro_method_catalog_sync_can_write_stubbed_snapshot() -> None:
|
||||
@@ -65,3 +66,55 @@ def test_vedastro_method_catalog_sync_can_write_stubbed_snapshot() -> None:
|
||||
snapshot = json.loads(output_path.read_text(encoding="utf-8"))
|
||||
assert "Marriage" in snapshot["tag_groups"]
|
||||
assert snapshot["summary"]["method_count"] == 2
|
||||
|
||||
|
||||
def test_vedastro_method_catalog_sync_can_build_stubbed_python_capability_registry() -> None:
|
||||
env = os.environ.copy()
|
||||
env["VEDASTRO_METHOD_CATALOG_STUB"] = json.dumps(
|
||||
{
|
||||
"source": "stubbed_catalog",
|
||||
"tag_groups": {},
|
||||
"python_capabilities": [
|
||||
{
|
||||
"method": "AllPlanetData",
|
||||
"signature": "(planetName, time)",
|
||||
"bucket": "planet_time",
|
||||
"parameter_names": ["planetName", "time"],
|
||||
"callable": True,
|
||||
},
|
||||
{
|
||||
"method": "AllHouseData",
|
||||
"signature": "(houseName, time)",
|
||||
"bucket": "house_name_time",
|
||||
"parameter_names": ["houseName", "time"],
|
||||
"callable": True,
|
||||
},
|
||||
{
|
||||
"method": "GetAllEventDataGroupedByTag",
|
||||
"signature": "()",
|
||||
"bucket": "zero_arg",
|
||||
"parameter_names": [],
|
||||
"callable": True,
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
completed = subprocess.run(
|
||||
[sys.executable, "scripts/vedastro_method_catalog_sync.py"],
|
||||
cwd=ROOT,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
timeout=120,
|
||||
check=False,
|
||||
env=env,
|
||||
)
|
||||
|
||||
assert completed.returncode == 0, completed.stderr or completed.stdout
|
||||
report = json.loads(completed.stdout)
|
||||
assert report["summary"]["python_capability_count"] == 3
|
||||
assert report["summary"]["python_callable_count"] == 3
|
||||
assert report["summary"]["python_signature_bucket_count"] >= 2
|
||||
assert any(item["method"] == "AllPlanetData" for item in report["python_capabilities"])
|
||||
buckets = report["python_signature_buckets"]
|
||||
assert buckets["planet_time"]["count"] == 1
|
||||
assert "AllPlanetData" in buckets["planet_time"]["examples"]
|
||||
|
||||
Reference in New Issue
Block a user