Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
50 lines
2.0 KiB
Python
50 lines
2.0 KiB
Python
"""BUG-2222 (upstream yinduzhanxing b6754475): Gaja Yoga per Raman combination 48 (pp.71–72, Chart 35)."""
|
||
from __future__ import annotations
|
||
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
ROOT = Path(__file__).resolve().parents[1]
|
||
sys.path.insert(0, str(ROOT / "scripts"))
|
||
|
||
from yoga_engine import YogaEngine # noqa: E402
|
||
|
||
|
||
def detect(positions, asc="Capricorn"):
|
||
e = YogaEngine(str(ROOT / "references" / "yoga_rules.json"))
|
||
e.rules = [r for r in e.rules if r["id"] == "bvr_gaja_yoga"]
|
||
assert len(e.rules) == 1
|
||
# BUG-2299: detect keeps her blocked row for a rule that could not be evaluated; the rule's own rows are the others.
|
||
rows = [r for r in e.detect(positions, asc, context={"chart_type": "D1"})
|
||
if r["rule_id"] == "bvr_gaja_yoga" and r.get("display_status") != "blocked"]
|
||
return rows, e.last_evaluation_failures
|
||
|
||
|
||
def test_chart35_role_overlap_is_explicit_and_not_a_second_moon():
|
||
(row,), _ = detect({"Moon": {"sign": "Scorpio", "house": 11},
|
||
"Mars": {"sign": "Taurus", "house": 5}})
|
||
assert row["condition_status"] == "conditions_met"
|
||
assert row["planets"] == ["Moon", "Mars"]
|
||
assert row["condition_checks"]["moon_is_seventh_lord"] is True
|
||
assert row["meaning_source_reference"].startswith("Raman")
|
||
|
||
|
||
def test_eleventh_lord_aspect_is_required():
|
||
assert detect({"Moon": {"sign": "Scorpio", "house": 11},
|
||
"Mars": {"sign": "Aquarius", "house": 2}}) == ([], [])
|
||
|
||
|
||
def test_natal_ninth_lord_cannot_replace_seventh_lord():
|
||
assert detect({"Moon": {"sign": "Aries", "house": 11},
|
||
"Saturn": {"sign": "Aries", "house": 11},
|
||
"Jupiter": {"sign": "Cancer", "house": 2},
|
||
"Mars": {"sign": "Libra", "house": 5}}, asc="Gemini") == ([], [])
|
||
|
||
|
||
def test_missing_aspector_is_unknown():
|
||
rows, failures = detect({"Moon": {"sign": "Scorpio", "house": 11}})
|
||
assert rows == []
|
||
failure, = failures
|
||
assert failure["condition_status"] == "incomplete_conditions"
|
||
assert failure["missing_inputs"] == ["Mars.house"]
|