コード例 #1
0
    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)
コード例 #2
0
 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)
コード例 #3
0
 def setUp(self):
     self.customer = Customer("Jack Jarvis", 1000)
     self.pet = Pet("Blue", "cat", "British Shorthair", 500)
コード例 #4
0
 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())
コード例 #5
0
async def pet(link):
    data = await _get_web_data(link)
    if data[0]:
        return Pet(data[1])
    else:
        return None
コード例 #6
0
 def setUp(self):
     self.pet = Pet("Sir Percy", "cat", "British Shorthair", 500)