"""Firdaria (LOG-11) — sekta, kolejność, długości okresów, podokresy.""" import datetime as dt from app.engine.firdaria import DAY_ORDER, NIGHT_ORDER, YEARS, firdaria, is_day_birth from app.significators import _event_tokens BIRTH = dt.datetime(1984, 4, 30, 7, 35, tzinfo=dt.timezone.utc) # horoskop referencyjny: Asc 112.18, MC 352.59, Sun 40.14 -> Day birth (notes3) ASC, MC, SUN = 112.18, 352.59, 40.14 def test_reference_is_day_birth(): assert is_day_birth(SUN, ASC, MC) is True # notes3: "Day birth (Diurnal)" def test_night_birth_uses_night_order(): # Słońce po stronie IC (przeciwna półkula) -> noc assert is_day_birth((SUN + 180) % 360, ASC, MC) is False fd = firdaria(BIRTH, (SUN + 180) % 360, ASC, MC) assert fd["sect"] == "night" and fd["order"] == NIGHT_ORDER def test_diurnal_sequence_and_totals(): fd = firdaria(BIRTH, SUN, ASC, MC) assert fd["sect"] == "day" and fd["order"] == DAY_ORDER lords = [p["lord"] for p in fd["periods"]] assert lords == DAY_ORDER + ["North Node", "South Node"] assert sum(p["years"] for p in fd["periods"]) == 75 # 70 + 3 + 2 def test_planet_majors_have_seven_subperiods_summing_to_period(): fd = firdaria(BIRTH, SUN, ASC, MC) for p in fd["periods"]: if p["lord"] in YEARS: assert len(p["sub"]) == 7 assert p["sub"][0]["lord"] == p["lord"] # sub zaczyna się od władcy okresu assert p["sub"][0]["start"] == p["start"] assert p["sub"][-1]["end"] == p["end"] else: assert "sub" not in p # węzły bez podokresów def test_periods_are_contiguous(): fd = firdaria(BIRTH, SUN, ASC, MC) for a, b in zip(fd["periods"], fd["periods"][1:]): assert a["end"] == b["start"] def test_age_42_is_saturn_major(): # kumulatywnie: Su10 Ve8 Me13 Mo9 -> 40; Saturn 40-51 -> wiek 42 w Saturnie fd = firdaria(BIRTH, SUN, ASC, MC) saturn = next(p for p in fd["periods"] if p["lord"] == "Saturn") assert saturn["start"].startswith("2024") and saturn["end"].startswith("2035") def test_event_tokens_firdaria(): ev = {"technique": "firdaria", "fd_major": "Saturn", "fd_sub": "Jupiter"} assert _event_tokens(ev) == ["[Sa", "[Ju"]