Upstream ce9fed15. The exception now tests C on the forward arc from B to A, in both the value and the trace. BUG-1387. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
import pytest
|
|
from scripts import tajika
|
|
|
|
|
|
@pytest.mark.parametrize('sun,moon,asc,expected,exception', [
|
|
(45, 120, 10, 115, True),
|
|
(45, 120, 60, 135, False),
|
|
(200, 100, 50, 310, False),
|
|
(200, 100, 150, 80, True),
|
|
])
|
|
def test_punya_matches_pvr_directed_arc(sun, moon, asc, expected, exception):
|
|
points = {'Sun': sun, 'Moon': moon}
|
|
assert tajika._calc_formula_saham('Punya_Saham', points, asc, True, {}) == expected
|
|
result = tajika._formula_saham_trace('Punya_Saham', points, asc, True, {})
|
|
assert result['longitude'] == expected
|
|
assert result['zodiacal_order_exception_applied'] is exception
|
|
|
|
|
|
def test_third_operand_is_used_even_when_not_ascendant(monkeypatch):
|
|
monkeypatch.setitem(tajika._SAHAM_RULES['sahams'], 'TestThird', {
|
|
'formula_day': ['Jupiter', 'Moon', 'Venus'],
|
|
'formula_night': ['Moon', 'Jupiter', 'Venus'],
|
|
})
|
|
points = {'Jupiter': 200., 'Moon': 50., 'Venus': 100.}
|
|
assert tajika._calc_formula_saham('TestThird', points, 60., True, {}) == 250.
|
|
assert tajika._calc_formula_saham('TestThird', points, 60., False, {}) == 340.
|