Copy the contents of animals.py into the file you just created.
As a team, we'll be building unit test coverage for all the functionality of the code in the animal
module. We'll discuss how writing tests often affect the implementation code, and how to think about covering edge cases in your test suite.
In the test class' setUpClass()
method, create an instance of Animal
and Dog
(Be sure to pass in a name argument). Write test cases to verify the I/O of the following methods of Animal
and Dog
.
- Animal object has the correct
name
property. - Set a species and verify that the object property of
species
has the correct value. - Invoking the
walk()
method sets the correct speed on the both objects. - The animal object is an instance of
Animal
. - The dog object is an instance of
Dog
.