def setUp(self): self.pet_1 = Pet("Sir Percy", "cat", "British Shorthair", 500) self.pet_2 = Pet("King Arthur", "dog", "Husky", 900) pets = [self.pet_1, self.pet_2] # store in list self.pet_shop = PetShop("Camelot of Pets", pets, 1000)
def setUp(self): # Set up is a special method that runs before each test # Before all of the tests below, this method will run # It resets the pet values before each test self.pet = Pet("Sir Percy", "cat", "British Shorthair", 500)
def setUp(self): self.customer = Customer("Jack Jarvis", 1000) self.pet = Pet("Blue", "cat", "British Shorthair", 500)
def test_can_add_pet_to_stock(self): new_pet = Pet("Lancelot", "dog", "Basset Hound", 750) self.pet_shop.add_pet(new_pet) self.assertEqual(3, self.pet_shop.stock_count())
async def pet(link): data = await _get_web_data(link) if data[0]: return Pet(data[1]) else: return None
def setUp(self): self.pet = Pet("Sir Percy", "cat", "British Shorthair", 500)