(cherry picked from commit 868f1dadb69e870fbf20223e4fcd0550286bc220)
24 lines
758 B
Python
24 lines
758 B
Python
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / 'scripts'))
|
|
|
|
from ashtakavarga import calc_ekadhipatya_shodhana, calc_trikona_shodhana # noqa: E402
|
|
|
|
|
|
def test_trikona_shodhana_removes_each_trine_baseline() -> None:
|
|
result = calc_trikona_shodhana(list(range(1, 13)))
|
|
assert result['reduced_scores'] == [0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8]
|
|
assert result['trikona_groups'][0]['baseline_removed'] == 1
|
|
|
|
|
|
def test_ekadhipatya_shodhana_records_occupied_vacant_pair() -> None:
|
|
result = calc_ekadhipatya_shodhana(
|
|
{'Sun': [0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0]},
|
|
{9},
|
|
)
|
|
assert result['rows']['Sun'][9:11] == [6, 0]
|
|
assert result['audit'][0]['pair'] == [9, 10]
|