This assumes you have setup your environment as described in [run_tests.md] and that you are in your virtualenv.
If you get stuck, take a peek at the solution.
-
We will be writing tests for catmath.py. This module contains only one function
cat_years_to_hooman_years
. -
Look at the existing tests. You can see there are test stubs:
test__cat_years_to_hooman_years__middle_age__succeeds
test__cat_years_to_hooman_years__less_than_one_year__succeeds
test__cat_years_to_hooman_years__0__returns_0
-
Fill in the body of these tests. Based on their names, what test case do you think each of these is trying to cover?
Each test should be calling
cat_years_to_hooman_years
with different input and asserting based on the output. -
When you have filled in the body of these tests, run them:
(catpy)user@host:~/catinabox$ python setup.py test
When the tests run successfully, you should see an increase in coverage!