# PetsDict Example # test2.py module # Unit test file. Tests of the followers field not included. from animal import Animal from pet import Pet import unittest class MyUnitTestClass(unittest.TestCase): def test_animal(self): a = Animal("dog", "German Shephard", "M") self.assertEqual(str(a), "dog German Shephard M") self.assertEqual(a.animal_type, "dog") self.assertEqual(a.breed, "German Shephard") self.assertEqual(a.gender, "M") def test_pet(self): p = Pet("dog", "German Shephard", \ "M", "Skipper", "James", True) self.assertEqual(str(p), "dog German Shephard M Skipper James True") self.assertEqual(p.name, "Skipper") self.assertEqual(p.owner, "James") self.assertEqual(p.is_vaccinated, True) if __name__ == '__main__': unittest.main( )