Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial wip #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ catpy/

# pycharm configuration
.idea

# vscode configuration
.vscode
34 changes: 30 additions & 4 deletions tests/test_catmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,44 @@


def test__cat_years_to_hooman_years__middle_age__succeeds():
assert True
cat_age = 5
human_age = catmath.cat_years_to_hooman_years(cat_age)
assert human_age == 25


def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
assert True
cat_age = 0.5
human_age = catmath.cat_years_to_hooman_years(cat_age)
assert human_age == (0.5 * 5)


def test__cat_years_to_hooman_years__0__returns_0():
assert True

cat_age = 0
human_age = catmath.cat_years_to_hooman_years(cat_age)
assert human_age == 0

# BONUS MATERIAL FOR STEP 2


def test__is_cat_leap_year__succeeds():
assert catmath.is_cat_leap_year(2016) is True


def test__is_cat_leap_year__not_divisible_by_4_isnt_leap_year():
assert catmath.is_cat_leap_year(123) is False


def test__is_cat_leap_year__not_divisible_by_4__isnt_leap_year():
assert catmath.is_cat_leap_year(1757) is False


def test__is_cat_leap_year__divisible_by_100__isnt_leap_year():
assert catmath.is_cat_leap_year(1900) is False


def test__is_cat_leap_year__centurial_leap_year__is_leap_year():
assert catmath.is_cat_leap_year(2000) is True


def test__is_cat_leap_year__typical_leap_year__is_leap_year():
assert catmath.is_cat_leap_year(2004) is True