"""Test functions for get_quarter_cycle.""" from unittest.mock import mock_open, patch from freezegun import freeze_time from dakiny_bot.dakiny_settings import ChannelIds, DakinySettings, Election, Params, PointSettings, RoleIds from dakiny_bot.election_utils import get_quarter_cycle # I only care about term start and term end for this test q1 = Election(True, "", "", "", "", "q1", "4/30", "2/1", "", "") # noqa: FBT003 q2 = Election(True, "", "", "", "", "q2", "7/31", "5/1", "", "") # noqa: FBT003 q3 = Election(True, "", "", "", "", "q3", "10/31", "8/1", "", "") # noqa: FBT003 q4 = Election(True, "", "", "", "", "q4", "1/31", "11/1", "", "") # noqa: FBT003 # Dummy all the values I don't care about. settings = DakinySettings( ChannelIds(1, 1, 1, 1, 1, 1), [q1, q2, q3, q4], Params("", "", 1), PointSettings(1, 1, 1, 1, 1, True, True), # noqa: FBT003 RoleIds(1, 1, 1, 1, 1), ) @patch("election_utils.get_quarter_cycle.settings", settings) @patch("builtins.open", new_callable=mock_open) class TestGetQuarterCycle: @freeze_time("2025-2-25") def test_regular_q1(self) -> None: assert get_quarter_cycle() == 0