def test_set_status(self):
     database.create_menu_table('speedy')
     database.update_status_restaurant('speedy', 'Not taking orders.')
     database.cursor.execute("SELECT status \
     FROM restaurants WHERE name = 'speedy'")
     status = database.cursor.fetchone()
     self.assertEqual('Not taking orders.', status[0])
    def test_add_pizza_price(self):
        database.create_menu_table('speedy')
        database.add('speedy', 'pizza', 3.50)
        database.cursor.execute("SELECT price \
        FROM speedy WHERE products = 'pizza'")
        price = database.cursor.fetchone()

        self.assertEqual(3.50, price[0])
 def test_is_open_opened(self):
     database.create_menu_table('speedy')
     database.open('speedy')
     self.assertTrue(database.is_open('speedy'))
 def test_is_open_closed(self):
     database.create_menu_table('speedy')
     self.assertFalse(database.is_open('speedy'))
 def test_is_there_such_restaurant(self):
     database.create_menu_table('speedy')
     self.assertTrue(database.is_there_such_restaurant('speedy'))
 def test_close_an_open_restaurant(self):
     database.create_menu_table('subway')
     database.open('subway')
     self.assertTrue(database.close('subway'))
 def test_open_an_opened_restaurant(self):
     database.create_menu_table('subway')
     database.open('subway')
     self.assertFalse(database.open('subway'))
 def test_open_closed_restaurant(self):
     database.create_menu_table('speedy')
     self.assertTrue(database.open('speedy'))
 def test_close_a_closed_restaurant(self):
     database.create_menu_table('speedy')
     self.assertFalse(database.close('speedy'))
 def test_add_pizza_twice(self):
     database.create_menu_table('speedy')
     database.add('speedy', 'pizza', 3.50)
     self.assertFalse(database.add('speedy', 'pizza', 4.00))
 def test_add_existing_restaurant(self):
     database.create_menu_table('speedy')
     self.assertFalse(database.create_menu_table('speedy'))
 def test_status_existing_restaurant(self):
     database.create_menu_table('speedy')
     self.assertEqual("Status is Not busy",
                      database.status_restaurant('speedy'))
 def test_not_valid_product(self):
     database.create_menu_table('speedy')
     database.add('speedy', 'pizza', 3.5)
     self.assertFalse(database.valid_product('speedy', 'spaghetti'))
 def test_valid_product(self):
     database.create_menu_table('speedy')
     database.add('speedy', 'pizza', 3.5)
     self.assertTrue(database.valid_product('speedy', 'pizza'))
def new():
    new_restaurant = input("Enter the name of the new restaurant: ")
    database.create_menu_table(new_restaurant)