fix: route synastry api through full ashtakoot engine

This commit is contained in:
732642856
2026-06-25 23:38:16 +08:00
parent b5fcc30fd8
commit 5e48f18da0
2 changed files with 30 additions and 3 deletions
+16 -1
View File
@@ -70,10 +70,25 @@ def test_synastry_rejects_non_numeric_moon_degree() -> None:
def test_synastry_normalizes_360_degree_boundary() -> None:
handler = _handler()
result = handler._compute_synastry({'male_moon': 360, 'female_moon': 0})
assert result['male']['nakshatra'] == result['female']['nakshatra']
assert result['male_details']['nakshatra'] == result['female_details']['nakshatra']
assert result['max_score'] == 36.0
def test_synastry_api_uses_full_ashtakoot_engine() -> None:
from ashtakoot import calculate_ashtakoot
handler = _handler()
api_result = handler._compute_synastry({'male_moon': 0, 'female_moon': 60})
engine_result = calculate_ashtakoot(0, 60)
assert api_result['method'] == engine_result['method']
assert api_result['scores'] == engine_result['scores']
assert api_result['total_score'] == engine_result['total_score']
assert api_result['is_match_approved'] == engine_result['is_match_approved']
assert api_result['scores']['Vashya'] == 0.5
assert 'BadConstellations' in api_result['additional_kutas']
def test_prashna_rejects_non_string_question() -> None:
handler = _handler()
with pytest.raises(BadRequest, match='question must be a string'):