Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
56 lines
2.4 KiB
Python
56 lines
2.4 KiB
Python
# BUG-2301: the astrologer's tests/test_yoga_learning_expression_sources.py at upstream 58f37ee5b, unchanged except this line.
|
|
from scripts.yoga_engine import ALL_PLANETS, YogaEngine
|
|
|
|
|
|
def run(rule, p, asc='Aries', d9=None):
|
|
engine = YogaEngine('references/yoga_rules.json')
|
|
engine.rules = [r for r in engine.rules if r['id'] == rule]
|
|
return engine.detect(p, asc, context={'panchanga': {'is_waning_moon': False}, 'd9': d9 or {}})
|
|
|
|
|
|
def planets():
|
|
return {p: {'house': 3, 'sign': 'Gemini'} for p in ALL_PLANETS}
|
|
|
|
|
|
def test_asatyavadi_alternative_survives_failed_definition():
|
|
p = planets()
|
|
d9 = {'planets': {'Venus': {'sign': 'Aries'}}}
|
|
row = run('bvr_asatyavadi_yoga', p, d9=d9)[0]
|
|
assert row['formation_evidence']['matched_paths'] == ['navamsa_dispositor_alternative']
|
|
assert not row['effects'] and 'effects_en' not in row
|
|
assert run('bvr_asatyavadi_yoga', p)[0]['formation_status'] == 'incomplete_conditions'
|
|
|
|
|
|
def test_asatyavadi_definition_missing_alternative_not_false_negative():
|
|
p = planets()
|
|
p.update(Venus={'house': 1, 'sign': 'Aries'}, Saturn={'house': 4}, Mars={'house': 9})
|
|
row = run('bvr_asatyavadi_yoga', p)[0]
|
|
assert row['formation_status'] == 'conditions_met'
|
|
assert row['formation_evidence']['unresolved_other_paths']
|
|
|
|
|
|
def test_buddhi_jada_requires_saturn_actual_aspect_not_merely_fifth():
|
|
p = planets()
|
|
p.update(Saturn={'house': 5}, Mars={'house': 7})
|
|
row = run('bvr_buddhi_jada_yoga', p)[0]
|
|
assert row['formation_status'] == 'conditions_met'
|
|
assert not row['effects']
|
|
p['Mars']['house'] = 6
|
|
assert run('bvr_buddhi_jada_yoga', p) == []
|
|
assert run('bvr_buddhi_jada_yoga', p, asc='Capricorn') == []
|
|
|
|
|
|
def test_buddhimaturya_definition_and_expanded_profile():
|
|
p = planets()
|
|
p.update(Jupiter={'house': 6, 'sign': 'Capricorn'}, Venus={'house': 12})
|
|
row = run('bvr_buddhimaturya_yoga', p, asc='Leo')[0]
|
|
assert row['formation_evidence']['matched_paths'] == ['definition']
|
|
# Aries fifth lord Sun is not naturally benefic; named remarks path still available.
|
|
p = planets()
|
|
p.update(Sun={'house': 5, 'sign': 'Leo'}, Venus={'house': 5, 'sign': 'Leo'})
|
|
row = run('bvr_buddhimaturya_yoga', p)[0]
|
|
assert row['formation_evidence']['matched_paths'] == ['remarks_distinct_benefic_companion']
|
|
assert not row['effects']
|
|
p['Venus']['house'] = 8
|
|
assert run('bvr_buddhimaturya_yoga', p) == []
|