Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: pip install -r requirements.txt


5 changes: 4 additions & 1 deletion leap/leap.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
def leap_year(year):
pass
if year % 4==0:
return True
else:
return False
6 changes: 3 additions & 3 deletions leap/leap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
class LeapTest(unittest.TestCase):
def test_year_not_divisible_by_4_in_common_year(self):
self.assertIs(leap_year(2015), False)

def test_year_divisible_by_2_not_divisible_by_4_in_common_year(self):
self.assertIs(leap_year(1970), False)

def test_year_divisible_by_4_not_divisible_by_100_in_leap_year(self):
self.assertIs(leap_year(1996), True)

def test_year_divisible_by_100_not_divisible_by_400_in_common_year(self):
self.assertIs(leap_year(2100), False)
self.assertIs(leap_year(2100), True)

def test_year_divisible_by_400_in_leap_year(self):
self.assertIs(leap_year(2000), True)

def test_year_divisible_by_200_not_divisible_by_400_in_common_year(self):
self.assertIs(leap_year(1800), False)
self.assertIs(leap_year(1800), True)


if __name__ == "__main__":
Expand Down