14 lines
530 B
Python
14 lines
530 B
Python
|
|
from django.test import SimpleTestCase
|
||
|
|
|
||
|
|
from apps.epic.utils import _planet_house
|
||
|
|
|
||
|
|
|
||
|
|
class PlanetHouseFallbackTest(SimpleTestCase):
|
||
|
|
def test_returns_1_when_no_cusp_matches(self):
|
||
|
|
# Pathological cusps list: all 12 cusps identical (zero-width arcs).
|
||
|
|
# No range has start < end, and the wrap-around condition is also
|
||
|
|
# never satisfied, so the loop exhausts without returning — hitting
|
||
|
|
# the fallback `return 1`.
|
||
|
|
cusps = [0.0] * 12
|
||
|
|
self.assertEqual(_planet_house(180.0, cusps), 1)
|