From 0ce8ab3a14398341498daee8ad052777644146bd Mon Sep 17 00:00:00 2001 From: Koshetarov <40320320+Koshetarov@users.noreply.github.com> Date: Wed, 27 Jun 2018 15:24:58 +0500 Subject: [PATCH] Update tests.py --- homework/tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homework/tests.py b/homework/tests.py index d4926c7..41778c1 100644 --- a/homework/tests.py +++ b/homework/tests.py @@ -12,8 +12,11 @@ def test_leap_year(): """ def is_leap_year(date): - pass - + + if date.year % 4 != 0 or (date.year % 100 == 0 and date.year % 400 != 0): + return False + else: + return True assert is_leap_year(datetime.date(year=2000, month=5, day=13)) assert is_leap_year(datetime.date(year=2016, month=11, day=1)) assert is_leap_year(datetime.date(year=1600, month=8, day=9))