Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 58458f7

Browse files
Merge pull request #716 from Praveensv11/main
Added test file
2 parents 2705164 + be41b42 commit 58458f7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
from calculate import judge_leap_year, month_days
3+
4+
def test_judge_leap_year():
5+
assert judge_leap_year(2000) == True
6+
assert judge_leap_year(2008) == True
7+
assert judge_leap_year(2023) == False
8+
assert judge_leap_year(1900) == False
9+
assert judge_leap_year(2400) == True
10+
assert judge_leap_year(2100) == False
11+
12+
def test_month_days():
13+
assert month_days(7, False) == 31
14+
assert month_days(4, True) == 30
15+
assert month_days(2, True) == 29
16+
assert month_days(2, False) == 28
17+
assert month_days(1, False) == 31
18+
assert month_days(11, True) == 30
19+
20+
# "pytest -s test_calculate.py" to test this file

0 commit comments

Comments
 (0)