def get_alcohol_pairings(): food = input('Enter the food: ') #user is prompted to enter a food # cocktail cocktail_data = cocktail.get_cocktail_data() # gets the cocktail api data cocktail_drink = cocktail_data.drink() #beer beer_data = beer.get_beer_data() # gets the beer api data beer_drink = beer_data.drink() #wine wine_data = wine.get_wine_data(food) # gets the wine api data wine_drink = wine_data.drink() print(f'Here is types of alcohol that would go good with your {food}\n' + f'Cocktail: {cocktail_drink}\n' + f'Beer: {beer_drink}\n' + f'Wine: {wine_drink}\n') save = input('Would you like to save this drink selection?? press Y to save, otherwise hit enter to continue: ').upper() if save == 'Y': save_selection(food, cocktail_drink, beer_drink, wine_drink) # saves the food, cocktail, beer, wine into the database picture = input('Would you like to view a picture of the drink in your web browsers?? press Y to view otherwise hit enter to continue: ').upper() if picture == 'Y': show_picture() else: main()
def main(): while True: try: banner() #prints the banner menu() # prints the menu selection = int(input('Select from the Menu: ')) if selection == 1: food = input( 'Enter the food: ') #user is prompted to enter a food # cocktail cocktail_data = cocktail.get_cocktail_data( ) # gets the cocktail api data cocktail_drink = cocktail_data.drink() #beer beer_data = beer.get_beer_data() # gets the beer api data beer_drink = beer_data.drink() #wine wine_data = wine.get_wine_data(food) # gets the wine api data wine_drink = wine_data.drink() save_selection( food, cocktail_drink, beer_drink, wine_drink ) # saves the food, cocktail, beer, wine into the database elif selection == 2: show_pairings() elif selection == 3: exit() else: break except Exception as e: print(e)
def show_instructions(): cocktaildata = cocktail.get_cocktail_data() cocktail_instructions = cocktaildata.instuctions() cocktail_ingredients = cocktaildata.ingredients() print(f'Here are the ingredients you will need! {cocktail_ingredients} To make the cockail here is the instructions \n {cocktail_instructions}') main()
def test_cocktail_api(self, mock_get_cocktail_data): mock_data = mock_get_cocktail_data.return_value = [{ "drinks": { "idDrink": "14195", "strDrink": "Snowball" } }] cocktail_call = cocktail.get_cocktail_data() self.assertEqual(mock_data, cocktail_call)
def show_picture(): cocktaildata = cocktail.get_cocktail_data() cocktailpicutre = cocktaildata.picture() print(f'Here is the url for your picutre simply copy and paste into your browser for your picture: {cocktailpicutre}') instructions_ingredients = input('Does this drink look incredibly tasty??? Would you like to know how to make it? Press Y or hit enter to contiune: ').upper() if instructions_ingredients == 'Y': show_instructions() main()