def add():
    restaurant = input("Name of the restaurant: ")
    if database.is_there_such_restaurant(restaurant):
        product = input("What do you want to add to the menu: ")
        price = input("What is the price of this product :")
        database.add(restaurant, product, price)
    else:
        print("There is no such restaurant")
def order(valid_user):
    print("These are our restaurants")
    database.display_restaurants()
    restaurant = input("Which menu you want to see: ")

    if database.is_there_such_restaurant(restaurant):
        database.menu(restaurant)
    else:
        print("There is no such restaurant")
        return False

    if database.is_open(restaurant):
        print("This restaurant is currently open!")

        while True:

            command = input("Type 'add','remove','ready' or 'exit'>")

            if command == 'add':
                add(valid_user, restaurant)

            elif command == 'remove':
                remove(valid_user)

            elif command == 'ready':
                final_details(valid_user)
                break

            elif command == 'exit':
                break

            else:
                print("Wrong command!")

    else:
        print("This restaurant is currently not open, sorry")
 def test_is_there_not_existing_restaurant(self):
     self.assertFalse(database.is_there_such_restaurant('speedy'))
 def test_is_there_such_restaurant(self):
     database.create_menu_table('speedy')
     self.assertTrue(database.is_there_such_restaurant('speedy'))
def close():
    restaurant = input("Which restaurant you want to close: ")
    if database.is_there_such_restaurant(restaurant):
        database.close(restaurant)
    else:
        print("There is no such restaurant")
def open():
    restaurant = input("Which restaurant you want to open: ")
    if database.is_there_such_restaurant(restaurant):
        database.open(restaurant)
    else:
        print("There is no such restaurant")