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

55 lines
1.7 KiB
Python

"""Source-bounded regression tests for Tribhagi Dasha."""
from __future__ import annotations
import json
from datetime import datetime
from pathlib import Path
from scripts.tribhagi_dasha import calculate_tribhagi_dasha
ROOT = Path(__file__).resolve().parents[1]
def test_tribhagi_full_cycle_divides_vimshottari_lord_years_across_nakshatras() -> None:
result = calculate_tribhagi_dasha({
"birth_datetime": datetime(2000, 1, 1, 12, 0),
"moon_longitude": 1.0,
})
assert result["execution_status"] == "executed"
assert result["mode"] == "full_120"
assert result["total_cycle"] == 120
assert len(result["major"]) == 27
assert result["major"][0]["lord"] == "Ketu"
assert result["major"][0]["full_years"] == 7 / 3
assert result["major"][1]["lord"] == "Venus"
assert result["period_depth_status"] == "mahadasha_executed_ad_pd_blocked_pending_row_level_replay"
assert "antardasha" not in result["major"][0]
def test_tribhagi_40_mode_returns_one_bhaga_without_promoting_pl9_semantics() -> None:
result = calculate_tribhagi_dasha({
"birth_datetime": "2000-01-01T12:00:00",
"moon_longitude": 1.0,
"mode": "single_bhaga_40",
})
assert result["execution_status"] == "executed"
assert result["mode"] == "single_bhaga_40"
assert result["total_cycle"] == 40
assert len(result["major"]) == 9
def test_tribhagi_rejects_unknown_mode() -> None:
result = calculate_tribhagi_dasha({
"birth_datetime": "2000-01-01T12:00:00",
"moon_longitude": 1.0,
"mode": "pl9_unknown",
})
assert result["execution_status"] == "blocked"
assert "mode must be" in result["reason"]