Пример #1
0
    def test_get_openings_not_exists(self):
        """
        test about the services restaurant to test the result of get opening
        hours of a restaurant without opening hours
        :return:
        """
        new_restaurant = Utils.create_restaurant()

        openings = RestaurantService.get_openings(new_restaurant.id)
        assert len(openings) == 0

        Utils.delete_restaurant(new_restaurant.id)
Пример #2
0
    def test_get_openings_ok(self):
        """
        test about the services restaurant to test the result of get opening
        hours of a restaurant
        :return:
        """
        new_restaurant = Utils.create_restaurant()
        new_opening1 = Utils.create_openings(new_restaurant.id, 2)
        new_opening2 = Utils.create_openings(new_restaurant.id, 3)
        new_opening3 = Utils.create_openings(new_restaurant.id, 5)

        openings = RestaurantService.get_openings(new_restaurant.id)
        assert len(openings) == 3

        Utils.delete_openings(new_opening1)
        Utils.delete_openings(new_opening2)
        Utils.delete_openings(new_opening3)
        Utils.delete_restaurant(new_restaurant.id)