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.
-
Take a look at the
cat_nap
method in catactivies.py. This method sleeps for the provided amount of time if the nap will be satisfying. If it won't be, an exception is raised. -
Look at the test stubs:
test__cat_nap__satisfying_nap
test__cat_nap__not_satisfying
-
Fill in the body of these tests, using
mock.patch
to control the behaviour oftime.sleep
.Be sure to check that
time.sleep
is called correctly! -
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, push them to your pull request:
(catpy)user@host:~/catinabox$ git commit -a
(catpy)user@host:~/catinabox$ git push origin master