Files
Jyotisha/tests/test_yoga_kalpadruma_source.py

43 lines
2.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# BUG-2301: the astrologer's tests/test_yoga_kalpadruma_source.py at upstream 58f37ee5b, unchanged except this line.
"""Independent named-chain replay of PVR pp139–140, not event calibration."""
from pathlib import Path
from scripts.yoga_engine import YogaEngine
def engine():
e = YogaEngine(str(Path(__file__).resolve().parents[1] / 'references/yoga_rules.json'))
e.rules = [r for r in e.rules if r['id'] == 'bvr_kalpadruma_yoga']
return e
def test_pvr_shivaji_named_chain_uses_second_members_navamsa():
# Only placements explicitly used by the source explanation. Not a
# reconstructed birth chart or a historical-outcome accuracy claim.
natal = {'Sun': {'sign': 'Aquarius', 'house': 7},
'Saturn': {'sign': 'Libra', 'house': 3},
'Venus': {'sign': 'Sagittarius', 'house': 5}}
row, = engine().detect(natal, 'Leo', context={'chart_type': 'D1',
'd9': {'planets': {'Saturn': {'sign': 'Aquarius'}}}})
assert row['formation_status'] == 'conditions_met'
assert set(row['planets']) == {'Sun', 'Saturn', 'Venus'}
assert row['evidence_dependencies']['independent_confirmation_count'] is None
def test_wrong_third_member_navamsa_cannot_rescue_failed_fourth_member():
natal = {'Sun': {'sign': 'Aquarius', 'house': 7},
'Saturn': {'sign': 'Libra', 'house': 3},
'Venus': {'sign': 'Sagittarius', 'house': 5},
'Mercury': {'sign': 'Cancer', 'house': 12}}
assert engine().detect(natal, 'Leo', context={'chart_type': 'D1', 'd9': {'planets': {
'Saturn': {'sign': 'Gemini'}, 'Venus': {'sign': 'Aquarius'}}}}) == []
def test_missing_required_navamsa_is_not_known_absence():
natal = {'Sun': {'sign': 'Aquarius', 'house': 7},
'Saturn': {'sign': 'Libra', 'house': 3},
'Venus': {'sign': 'Sagittarius', 'house': 5}}
row, = engine().detect(natal, 'Leo', context={'chart_type': 'D1'})
assert row['formation_status'] == 'incomplete_conditions'
assert 'Saturn.D9_sign' in row['missing_inputs']
assert not row['effects']