Upstream e7301feb, 86935c0a, and 4f1536f2. Ketu reverses the count, the ninth is the fifth's obstruction, and a remaining tie stays strength_comparison_required so the consultation card shows 待定. BUG-1386. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
62 lines
2.6 KiB
Python
62 lines
2.6 KiB
Python
from scripts.argala import calc_argala_for_reference
|
|
from scripts.consultation_native_layers import build_argala
|
|
|
|
|
|
def test_equal_occupancy_uses_rath_role_contacts():
|
|
# Taurus: Venus in own sign + Jupiter's fixed-sign aspect from Libra.
|
|
# Pisces: Mars occupant, no Mercury/Jupiter/lord contact.
|
|
chart = dict(Sun=0, Moon=0, Mars=11, Mercury=0, Jupiter=6, Venus=1, Saturn=0)
|
|
pair = calc_argala_for_reference(0, chart)['primary']['H2']
|
|
assert pair['effective'] is True
|
|
assert pair['strength_comparison']['status'] == 'selected'
|
|
assert pair['strength_comparison']['selected_sign_idx'] == 1
|
|
assert '须比较' not in pair['effect']
|
|
|
|
|
|
def test_partial_chart_does_not_turn_missing_roles_into_zero():
|
|
pair = calc_argala_for_reference(0, dict(Moon=1, Mars=11))['primary']['H2']
|
|
assert pair['effective'] is None
|
|
assert pair['strength_comparison']['reason'] == 'missing_classical_planet_signs'
|
|
|
|
|
|
def test_still_tied_pair_stays_unresolved():
|
|
# One occupant each, and neither sign receives a Jupiter, Mercury, or lord aspect.
|
|
chart = dict(Sun=0, Moon=0, Mars=11, Mercury=4, Jupiter=0, Venus=1, Saturn=0)
|
|
result = calc_argala_for_reference(0, chart)
|
|
pair = result['primary']['H2']
|
|
assert pair['effective'] is None
|
|
assert pair['strength_comparison']['reason'] == 'later_argala_sign_strength_rules_required'
|
|
assert result['net_result'] == 'strength_comparison_required'
|
|
assert result['verdict_label'] == '待定'
|
|
assert result['verdict_label'] not in ('无', '被阻挡')
|
|
|
|
|
|
def test_unresolved_tie_reaches_consultation_layer_and_card_payload():
|
|
chart = {
|
|
'ascendant': {'sign': 'Aries'},
|
|
'planets': {
|
|
'Sun': {'sign': 'Aries'},
|
|
'Moon': {'sign': 'Aries'},
|
|
'Mars': {'sign': 'Pisces'},
|
|
'Mercury': {'sign': 'Leo'},
|
|
'Jupiter': {'sign': 'Aries'},
|
|
'Venus': {'sign': 'Taurus'},
|
|
'Saturn': {'sign': 'Aries'},
|
|
},
|
|
}
|
|
layer = build_argala(chart)
|
|
house = layer['houses']['house_1']
|
|
assert layer['status'] == 'executed'
|
|
assert house['net_result'] == 'strength_comparison_required'
|
|
assert house['verdict_label'] == '待定'
|
|
card = {
|
|
'method': layer['method'],
|
|
'summary': layer['summary'],
|
|
'houses': layer['houses'],
|
|
}
|
|
assert card['summary']['unresolved_label'] == '待定'
|
|
assert 'house_1' in card['summary']['unresolved_houses']
|
|
assert card['houses']['house_1']['verdict_label'] == '待定'
|
|
assert '无' not in card['houses']['house_1']['verdict_label']
|
|
assert '被阻挡' not in card['houses']['house_1']['verdict_label']
|