Files
Jyotisha/tests/test_yoga_satkatha_source.py

40 lines
1.7 KiB
Python

# BUG-2301: the astrologer's tests/test_yoga_satkatha_source.py at upstream 58f37ee5b, unchanged except this line.
from scripts.yoga_engine import ALL_PLANETS, YogaEngine
def run(jupiter=11, mercury=6, d9='Pisces'):
planets = {p: {'house': 1} for p in ALL_PLANETS}
planets['Jupiter']['house'] = jupiter
planets['Mercury']['house'] = mercury
engine = YogaEngine('references/yoga_rules.json')
engine.rules = [r for r in engine.rules if r['id'] == 'bvr_satkathadisravana_yoga']
return engine.detect(planets, 'Aries', context={
'panchanga': {'is_waning_moon': True},
'd9': {'planets': {'Mercury': {'sign': d9}}}})
def test_received_house_aspect_is_not_lord_aspect():
row = run()[0]
assert row['condition_checks']['third_house_received_benefic_aspects'] == ['Jupiter']
assert row['condition_checks']['third_lord_received_benefic_aspects'] == []
assert row['formation_status'] == 'incomplete_conditions'
assert not row['effects']
def test_remarks_tracks_lord_independently_of_house():
row = run(jupiter=2, mercury=6)[0]
assert row['condition_checks']['third_house_received_benefic_aspects'] == []
assert row['condition_checks']['third_lord_received_benefic_aspects'] == ['Jupiter']
assert row['formation_evidence']['matched_geometry_paths'] == ['remarks_received_aspect']
def test_d9_observation_never_automatically_satisfies_undefined_amsa():
for d9 in ('Pisces', 'Virgo', None):
row = run(d9=d9)[0]
assert row['formation_status'] == 'incomplete_conditions'
assert row['condition_checks']['third_lord_d9_sign_observation'] == d9
def test_known_absence_of_both_aspect_paths():
assert run(jupiter=1, mercury=2) == []