Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
59 lines
3.0 KiB
Python
59 lines
3.0 KiB
Python
# BUG-2301: the astrologer's tests/test_yoga_netranasa_source.py at upstream 58f37ee5b, unchanged except the skip markers (reasons inline).
|
|
import pytest
|
|
|
|
from scripts.yoga_engine import DEBILITATION, SIGNS, YogaContext, YogaEngine
|
|
|
|
|
|
def run(planets, asc='Aries', d9=None):
|
|
e = YogaEngine('references/yoga_rules.json')
|
|
e.rules = [r for r in e.rules if r['id'] == 'bvr_netranasa_yoga']
|
|
return e.detect(planets, asc, context={'d9': {'planets': d9 or {}}})[0]
|
|
|
|
|
|
@pytest.mark.parametrize('asc', SIGNS)
|
|
def test_literal_conjunction_for_every_ascendant_despite_missing_alternative(asc):
|
|
ctx = YogaContext({}, asc)
|
|
lords = {ctx.lord_of_house(h) for h in (2, 6, 10)}
|
|
row = run({p: {'house': 1} for p in lords}, asc)
|
|
assert row['formation_status'] == 'conditions_met'
|
|
assert set(row['planets']) == lords
|
|
assert row['formation_evidence']['unresolved_other_paths']
|
|
assert not row['effects']
|
|
assert row['effect_assessment']['personal_outcome_established'] is False
|
|
|
|
|
|
def test_sixth_lord_aspect_does_not_replace_conjunction():
|
|
# Aries: L2 Venus, L6 Mercury, L10 Saturn.
|
|
row = run({'Venus': {'house': 1}, 'Mercury': {'house': 7}, 'Saturn': {'house': 1}})
|
|
assert row['condition_checks']['d1_conjunction'] is False
|
|
assert row['formation_status'] == 'incomplete_conditions'
|
|
assert row['formation_evidence']['matched_paths'] == []
|
|
|
|
|
|
def test_d1_debility_is_not_neechamsa_and_d9_observation_not_promoted():
|
|
p = {name: {'house': 2, 'sign': DEBILITATION[name]} for name in ('Venus', 'Mercury', 'Saturn')}
|
|
row = run(p)
|
|
assert all(v is None for v in row['condition_checks']['d9_debilitation_observations'].values())
|
|
d9 = {name: {'sign': DEBILITATION[name]} for name in p}
|
|
row = run(p, d9=d9)
|
|
assert all(row['condition_checks']['d9_debilitation_observations'].values())
|
|
assert row['formation_status'] == 'incomplete_conditions'
|
|
assert row['formation_evidence']['matched_paths'] == []
|
|
|
|
|
|
def test_unknown_conjunction_distinct_from_known_false():
|
|
assert run({'Venus': {'house': 1}})['condition_checks']['d1_conjunction'] is None
|
|
assert run({'Venus': {'house': 2}})['condition_checks']['d1_conjunction'] is False
|
|
row = run({'Venus': {'house': True}, 'Mercury': {'house': 1}, 'Saturn': {'house': 1}})
|
|
assert row['condition_checks']['d1_conjunction'] is None
|
|
|
|
|
|
@pytest.mark.skip(reason='BUG-2301: checks her report pack (professional_parity_closure.build_yoga_interpretation_pack); this site builds yoga pages in pl9_interpretation_packs, gated per tests/test_yoga_effect_gate_2300.py')
|
|
def test_actual_report_keeps_qualification_not_medical_outcome():
|
|
from scripts.professional_parity_closure import build_yoga_interpretation_pack
|
|
row = run({p: {'house': 1} for p in ('Venus', 'Mercury', 'Saturn')})
|
|
page = build_yoga_interpretation_pack({'yogas': [row]})['pages'][0]
|
|
assert page['effect_assessment'] == row['effect_assessment']
|
|
assert not page['claim_permissions']['event_outcome']
|
|
assert '不据此判断视力' in page['sections']['result']
|