Files
Jyotisha/tests/test_upstream_sync9_tithi_lord_source.py
T
jesse-uxandGrok (agent loop) 9d3f59a872 fix(tithi): use the source lord order (BUG-1473, upstream 33537b31)
Tithi lords follow tithi_seed. No new scripts/tithi_ashtottari.py. Upstream source tests passed.

Co-Authored-By: Grok (agent loop)
2026-10-28 09:45:06 +08:00

35 lines
1.5 KiB
Python

import pytest
from scripts.tithi_lord import calc_tithi_lord_full, get_tithi_lord
# PVR table 3, file p24. Independent explicit source expectation.
EXPECTED = ('Sun Moon Mars Mercury Jupiter Venus Saturn Rahu Sun Moon Mars Mercury Jupiter Venus Saturn '
'Sun Moon Mars Mercury Jupiter Venus Saturn Rahu Sun Moon Mars Mercury Jupiter Venus Rahu').split()
@pytest.mark.parametrize('number,lord',list(enumerate(EXPECTED,1)))
def test_all_thirty_report_rulers_and_angular_boundaries(number,lord):
at_start=calc_tithi_lord_full(0,(number-1)*12)
just_before_end=calc_tithi_lord_full(0,number*12-1e-7)
for result in (at_start,just_before_end):
assert result['tithi_absolute']==number
assert result['tithi_lord_name']==lord
def test_new_and_full_moon_differ_and_chart_link_follows_correct_lord():
full=calc_tithi_lord_full(0,174)
new=calc_tithi_lord_full(0,354,{'Rahu':{'sign':'Taurus','house':2}}, {})
assert full['tithi_lord_name']=='Saturn'
assert new['tithi_lord_name']=='Rahu'
assert full['special_note'] != new['special_note']
assert new['tithi_lord_sign']=='Taurus'
assert new['tithi_lord_house']==2
assert new['tithi_lord_interpretation']
assert calc_tithi_lord_full(0,360)['tithi_absolute']==1
@pytest.mark.parametrize('number,paksha',[(True,'Shukla'),(0,'Shukla'),(16,'Krishna'),(1,'unknown')])
def test_invalid_seed_is_not_silently_accepted(number,paksha):
with pytest.raises(ValueError):get_tithi_lord(number,paksha)