Files
Jyotisha/tests/test_chaturshitisama_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

76 lines
2.6 KiB
Python

"""Source-bounded regression tests for Chaturshitisama MD."""
from __future__ import annotations
import json
from datetime import datetime
from pathlib import Path
from scripts.chaturshitisama_dasha import (
calculate_chaturshitisama_dasha,
chaturshitisama_applicability,
)
ROOT = Path(__file__).resolve().parents[1]
def test_chaturshitisama_requires_tenth_lord_in_tenth() -> None:
result = chaturshitisama_applicability(ascendant_longitude=0.0, tenth_lord_sign_index=9)
assert result["applicable"] is True
assert result["ascendant_sign_index"] == 0
assert result["tenth_house_sign_index"] == 9
def test_chaturshitisama_rejects_other_tenth_lord_positions() -> None:
result = chaturshitisama_applicability(ascendant_longitude=0.0, tenth_lord_sign_index=10)
assert result["applicable"] is False
assert result["reason"] == "Chaturshitisama requires the 10th lord to occupy the 10th house."
def test_chaturshitisama_blocks_without_explicit_lord_position() -> None:
result = calculate_chaturshitisama_dasha({
"birth_datetime": "2000-01-01T00:00:00",
"ascendant_longitude": 0.0,
"moon_longitude": 190.0,
})
assert result["execution_status"] == "blocked"
assert "tenth_lord_sign_index" in result["reason"]
def test_chaturshitisama_emits_only_source_bounded_md() -> None:
result = calculate_chaturshitisama_dasha({
"birth_datetime": datetime(2000, 1, 1, 12, 0),
"ascendant_longitude": 0.0,
"tenth_lord_sign_index": 9,
"moon_longitude": 190.0,
})
assert result["execution_status"] == "executed"
assert result["confidence_status"] == "parameter_sensitive"
assert result["total_cycle"] == 84
assert result["starting_lord"] == "Sun" # Swati is the seed.
assert result["major"][0]["start_date"] == "2000-01-01T12:00:00"
assert result["major"][0]["years"] < 12.0
assert result["period_depth_status"] == "mahadasha_executed_ad_pd_blocked_pending_row_level_replay"
assert "antardasha" not in result["major"][0]
def test_chaturshitisama_standard_table_profile_preserves_unmet_gate_but_emits_rows() -> None:
result = calculate_chaturshitisama_dasha({
"birth_datetime": "2000-01-01T12:00:00",
"ascendant_longitude": 0.0,
"tenth_lord_sign_index": 10,
"moon_longitude": 190.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