Files
Jyotisha/tests/test_satabdika_dasha.py
T
Jesse_ChenandCursor 04ad3325d5
Independent Staging Quality Gate / validate (push) Successful in 11m26s
Independent Staging Quality Gate / publish (push) Successful in 13m24s
fix(relationship): freeze marriage event classes and add conditional dashas (BUG-608)
Venus/Jupiter/Moon periods no longer collapse into one marriage-opportunity line. Full reading reports the ten BPHS conditional dasha families; Skill 6.9.16.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 16:04:52 +08:00

65 lines
2.8 KiB
Python

"""Source-bounded regression tests for Satabdika MD."""
from datetime import datetime
from scripts.satabdika_dasha import calculate_satabdika_dasha, satabdika_applicability
from scripts.source_bounded_child_periods import PYJHORA_PARENT_SEEDED_EQUAL_SPLIT_PROFILE
def test_satabdika_requires_explicit_vargottama_lagna() -> None:
assert satabdika_applicability(ascendant_longitude=5.0, navamsa_ascendant_sign_index=0)["applicable"]
assert not satabdika_applicability(ascendant_longitude=5.0, navamsa_ascendant_sign_index=1)["applicable"]
def test_satabdika_requires_navamsa_input() -> None:
result = calculate_satabdika_dasha({"birth_datetime": "2000-01-01T00:00:00", "ascendant_longitude": 5.0, "moon_longitude": 350.0})
assert result["execution_status"] == "blocked"
assert "navamsa_ascendant_sign_index" in result["reason"]
def test_satabdika_emits_only_source_bounded_md() -> None:
result = calculate_satabdika_dasha({
"birth_datetime": datetime(2000, 1, 1), "ascendant_longitude": 5.0,
"navamsa_ascendant_sign_index": 0, "moon_longitude": 350.0,
})
assert result["execution_status"] == "executed"
assert result["starting_lord"] == "Sun" # Revati is the seed.
assert result["total_cycle"] == 100
assert result["period_depth_status"] == "mahadasha_executed_ad_pd_blocked_pending_row_level_replay"
assert "antardasha" not in result["major"][0]
def test_satabdika_standard_table_profile_preserves_unmet_gate_but_emits_rows() -> None:
result = calculate_satabdika_dasha({
"birth_datetime": "2000-01-01T00:00:00",
"ascendant_longitude": 5.0,
"navamsa_ascendant_sign_index": 1,
"moon_longitude": 350.0,
"standard_table_profile": "pl9_reports_all_dasha_tables_v1",
})
assert result["execution_status"] == "executed"
assert result["classical_applicable"] is False
assert result["standard_table_profile"] == "pl9_reports_all_dasha_tables_v1"
assert len(result["major"]) == 7
def test_satabdika_can_emit_pyjhora_observed_child_profile_when_explicit() -> None:
result = calculate_satabdika_dasha({
"birth_datetime": datetime(2000, 1, 1),
"ascendant_longitude": 5.0,
"navamsa_ascendant_sign_index": 0,
"moon_longitude": 350.0,
"child_period_profile": PYJHORA_PARENT_SEEDED_EQUAL_SPLIT_PROFILE,
})
first_md = result["major"][0]
first_ad = first_md["antardasha"][0]
first_pd = first_ad["pratyantardasha"][0]
assert result["period_depth_status"] == "mahadasha_antardasha_pratyantardasha_executed_pyjhora_observed_profile"
assert len(result["antardasha"]) == 49
assert len(result["pratyantardasha"]) == 343
assert first_ad["lord"] == first_md["lord"]
assert first_pd["lord"] == first_ad["lord"]
assert first_md["antardasha"][-1]["end_date"] == first_md["end_date"]