def test_get_photo_with_url_not_exists(self): """ test about the services restaurant to test the result of get photo of a restaurant uring a not existing URL :return: """ photos = RestaurantService.get_photo_with_url("http://phototest1.com") assert len(photos) == 0
def test_get_photo_with_url_ok(self): """ test about the services restaurant to test the result of get photo of a restaurant uring its URL :return: """ new_restaurant = Utils.create_restaurant() new_photo = Utils.create_photo(new_restaurant.id, "http://phototest1.com") photos = RestaurantService.get_photo_with_url("http://phototest1.com") assert len(photos) == 1 assert photos[0].restaurant_id == new_restaurant.id assert photos[0].url == "http://phototest1.com" Utils.delete_photo(new_photo.id) Utils.delete_restaurant(new_restaurant.id)