exercism/python/leap/leap_test.py
anthony.cicchetti 5f9cd49d7a initial commit
2017-04-25 15:51:48 -04:00

24 lines
551 B
Python

import unittest
from leap import is_leap_year
class YearTest(unittest.TestCase):
def test_leap_year(self):
self.assertIs(is_leap_year(1996), True)
def test_non_leap_year(self):
self.assertIs(is_leap_year(1997), False)
def test_non_leap_even_year(self):
self.assertIs(is_leap_year(1998), False)
def test_century(self):
self.assertIs(is_leap_year(1900), False)
def test_exceptional_century(self):
self.assertIs(is_leap_year(2400), True)
if __name__ == '__main__':
unittest.main()