From b128171513f9fbed19370516d06b37834cea286f Mon Sep 17 00:00:00 2001 From: Tammo Behrends Date: Wed, 22 Mar 2017 13:26:18 +0100 Subject: [PATCH] leap: Update test cases Adds the changes made to the the canonical test data in https://github.com/exercism/x-common/pull/463 and stores the test data version. --- exercises/leap/leap_test.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/exercises/leap/leap_test.py b/exercises/leap/leap_test.py index 152d88e12f6..2b99eb8bf5a 100644 --- a/exercises/leap/leap_test.py +++ b/exercises/leap/leap_test.py @@ -3,21 +3,20 @@ from leap import is_leap_year -class YearTest(unittest.TestCase): - def test_leap_year(self): - self.assertIs(is_leap_year(1996), True) +# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0 - def test_non_leap_year(self): - self.assertIs(is_leap_year(1997), False) +class YearTest(unittest.TestCase): + def test_year_not_divisible_by_4(self): + self.assertFalse(is_leap_year(2015)) - def test_non_leap_even_year(self): - self.assertIs(is_leap_year(1998), False) + def test_year_divisible_by_4_not_divisible_by_100(self): + self.assertTrue(is_leap_year(2016)) - def test_century(self): - self.assertIs(is_leap_year(1900), False) + def test_year_divisible_by_100_not_divisible_by_400(self): + self.assertFalse(is_leap_year(2100)) - def test_exceptional_century(self): - self.assertIs(is_leap_year(2400), True) + def test_year_divisible_by_400(self): + self.assertTrue(is_leap_year(2000)) if __name__ == '__main__':