def test_four(self):
        restaurant = Restaurant(self.connection_string)
        order_num = restaurant.place_order(self.input[4])
        self.assertLessEqual(0, order_num, "Didn't retrieve proper order number")

        order_num = restaurant.place_order('Hamburger')
        result = self.query("SELECT * FROM orders WHERE order_number=%s", (order_num,))
        self.assertIsNotNone(result[0][4], "New order was not marked filled")
Exemplo n.º 2
0
    def test_five(self):
        restaurant = Restaurant(self.connection_string)
        result = restaurant.find_ingredients_by_cost(self.input[5])

        self.assertEqual(3, len(result),
                         "Did not retrieve the right number of recipes")
        self.assertIn(('Milkshake', ), result,
                      "Did not retrieve Milkshake experimental recipe")
Exemplo n.º 3
0
    def test_three(self):
        restaurant = Restaurant(self.connection_string)
        result = restaurant.find_course_recipes(self.input[3])

        self.assertEqual(3, len(result),
                         "Did not retrieve the right number of recipes")
        self.assertIn(('Milkshake', ), result,
                      "Did not retrieve Milkshake experimental recipe")
    def test_two(self):
        restaurant = Restaurant(self.connection_string)
        result = restaurant.find_ingredient_better(self.input[2])

        self.assertEqual(16, len(result), "Did not retrieve all ingredients")