import unittest

from utils import run_file


class TestLeapYear(unittest.TestCase):
    def test_po_leap_year(self):
        self.leap_year("PO")

    def test_co_leap_year(self):
        self.leap_year("CO")

    def leap_year(self, mode):
        self.assertTrue(run_file(["leap_year.alc", "primitives.alc"],
            [2016, 2015, 2014, 2013, 2012, 2001, 2000, 1999],
            [True, False, False, False, True, False, False, False],
            mode))
