mirror of
https://github.com/Xevion/exercism.git
synced 2026-01-31 08:24:14 -06:00
'init'
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"track":"python","exercise":"leap","id":"299afd8086d543ccb59fa20a3375c3bc","url":"https://exercism.io/my/solutions/299afd8086d543ccb59fa20a3375c3bc","handle":"Xevion","is_requester":true,"auto_approve":false}
|
||||
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
|
||||
from leap import leap_year
|
||||
|
||||
|
||||
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.5.1
|
||||
|
||||
|
||||
class LeapTest(unittest.TestCase):
|
||||
def test_year_not_divisible_by_4(self):
|
||||
self.assertIs(leap_year(2015), False)
|
||||
|
||||
def test_year_divisible_by_2_not_divisible_by_4(self):
|
||||
self.assertIs(leap_year(1970), False)
|
||||
|
||||
def test_year_divisible_by_4_not_divisible_by_100(self):
|
||||
self.assertIs(leap_year(1996), True)
|
||||
|
||||
def test_year_divisible_by_100_not_divisible_by_400(self):
|
||||
self.assertIs(leap_year(2100), False)
|
||||
|
||||
def test_year_divisible_by_400(self):
|
||||
self.assertIs(leap_year(2000), True)
|
||||
|
||||
def test_year_divisible_by_200_not_divisible_by_400(self):
|
||||
self.assertIs(leap_year(1800), False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user