We have a class called PetOwner with a constructor that takes the following attributes in the following order:
- owner — the name of the owner;
- spec — the type of pet they own (e.g. cat, dog, snake, hamster);
- pet_name — the name of the pet.
You want to test a method of this class called owner_with_pet() which returns a string like this: 'owner has a spec named pet_name'. You also plan to test some other methods later.
Use the setUp() to create an instance of the class only once with the following attributes: owner — 'Polly', spec — 'parrot', pet_name — 'Joshy'. Look carefully at the other tests before doing it.
In this Code Challenge, you do not need to import the module with the class at the beginning of the code. To create an instance of the class, just call the constructor.