def setUp(self): drink_1 = Drink("Guinness", 3, 3) drink_2 = Drink("Whiskey Sour", 6, 5) drink_3 = Drink("Tsingtao", 4, 3) drinks_list = [drink_1, drink_2, drink_3] self.room_1 = Room("Plush Paradise", 3) self.bar_1 = Bar(500, drinks_list) self.venue_1 = Venue("Cara's OK Karaoke", [self.room_1], self.bar_1) self.song_1 = Song(10001, "Let's Make Love and Listen to Death from Above", "CSS", [3, 30], 2005) self.song_2 = Song(10002, "Song 2", "Blur", [2, 2], 1996) self.song_3 = Song(10003, "E-Mail My Heart", "Britney Spears", [3, 41], 1999) self.song_4 = Song(10004, "Club Tropicana", "Wham!", [4, 28], 1983) self.song_5 = Song(10005, "Virtual Insanity", "Jamiroquai", [4, 4], 1996) self.guest_1 = Guest("Lovefoxxx", 36, 50, self.song_1) self.guest_2 = Guest("Britney Spears", 38, 100, self.song_4) self.guest_3 = Guest("Damon Albarn", 52, 20, self.song_3) self.guest_4 = Guest("Jamiroquai", 50, 5, self.song_5) self.guest_5 = Guest("Human Child", 8, 20, self.song_2) self.guest_6 = Guest("Jay-Z", 50, 10000, self.song_5) self.guest_7 = Guest("Shania Twain", 55, 80, self.song_1)
def setUp(self): # Drinks self.drink_1 = Drink("Tennents", 3.50, True) self.drink_2 = Drink("Coca Cola", 2.00, False) # Songs self.song_1 = Song("Shake It Off", "Taylor Swift", 219) self.song_2 = Song("Sweet Caroline", "Neil Diamond", 201) self.song_3 = Song("YMCA", "Village People", 287) self.song_4 = Song("I'm Gonna Be (500 Miles)", "The Proclaimers", 217) # Guests self.guest_1 = Guest("Alice", 43, 30.00, self.song_3) self.guest_2 = Guest("Bob", 45, 60.00, self.song_3) self.guest_3 = Guest("Charlie", 21, 15.50, self.song_3) self.guest_4 = Guest("David", 17, 10.00, self.song_2) self.guest_5 = Guest("Emma", 24, 29.95, self.song_2) self.guest_6 = Guest("Freddie", 31, 5.00, self.song_1) group_1 = [self.guest_1, self.guest_2, self.guest_3, self.guest_4, self.guest_5] # Rooms self.room_1 = Room(1, 4) self.room_2 = Room(2, 5) self.room_2.guests = group_1
def setUp(self): self.customer = Customer("Testy McTest", 30, 25.00) self.drinks = { "Weak Beer": Drink("Smol Beer", 2, 3.00), "Strong Beer": Drink("Tol Boi", 4, 4.50) } self.food = Food("Pie", 5, 3)
def setUp(self): drinkCollection = [ Drink("Smol Beer", 2, 3.00), Drink("Tol Boi", 4, 4.50) ] self.pub = Pub("The Testing Arms", drinkCollection) self.customers = { "customer older than 18": Customer("Rosie", 29, 25.00), "customer younger than 18": Customer("Oliver", 10, 4) }
def setUp(self): # Drinks self.drink_1 = Drink("Tennents", 3.50, True) self.drink_2 = Drink("Coca Cola", 2.00, False) # Songs self.song_1 = Song("Shake It Off", "Taylor Swift", 219) self.song_2 = Song("Sweet Caroline", "Neil Diamond", 201) self.song_3 = Song("YMCA", "Village People", 287) # Guests self.guest_1 = Guest("Alice", 43, 30.00, self.song_3) self.guest_4 = Guest("David", 17, 10.00, self.song_2) self.guest_6 = Guest("Freddie", 31, 5.00, self.song_1)
def setUp(self): drink_1 = Drink("Guinness", 3, 3) drink_2 = Drink("Whiskey Sour", 6, 5) drink_3 = Drink("Tsingtao", 4, 3) drinks_list = [drink_1, drink_2, drink_3] self.bar_1 = Bar(500, drinks_list) self.song_1 = Song(10001, "Let's Make Love and Listen to Death from Above", "CSS", [3,30], 2005) self.song_4 = Song(10004, "Club Tropicana", "Wham!", [4, 28], 1983) self.guest_1 = Guest("Lovefoxxx", 36, 50, self.song_1) self.guest_2 = Guest("Britney Spears", 38, 100, self.song_4) self.room_1 = Room("Plush Paradise", 3)
def setUp(self): self.guest_1 = Guest("Gavin", 35, "Closing Time", 50.00) self.guest_2 = Guest("Ailsa", 27, "Romeo and Juliet", 45.00) self.guest_3 = Guest( "Stewart", 32, "Just Dropped In (To See What Condition My Condition Was In)", 55.00) self.guest_4 = Guest("Karissa", 27, "Super Trouper", 48.00) self.guest_5 = Guest("Isla", 28, "Oops! I Did it Again", 52.00) self.guest_6 = Guest("Kirsty", 16, "What's My Age Again?", 25.00) self.song_1 = Song("Closing Time", "Semisonic", "Alt Rock") self.song_2 = Song("Romeo and Juliet", "Dire Straits", "Rock") self.song_3 = Song("Thank You For the Music", "ABBA", "Pop") room_songs = {self.song_1, self.song_2, self.song_3} self.room_1 = Room("Jungle Room", 5, 50.00, room_songs) self.drink_1 = Drink("Cocktail Pitcher", 12.00) self.drink_2 = Drink("Punk IPA", 5.00)
def setUp(self): self.song_1 = Song("Closing Time", "Semisonic", "Alt Rock") self.song_2 = Song("Romeo and Juliet", "Dire Straits", "Rock") self.song_3 = Song("Thank You For the Music", "ABBA", "Pop") self.song_4 = Song("I Miss You", "Blink-182", "Pop-Punk") song_catalogue = [self.song_1, self.song_2, self.song_3, self.song_4] self.room_1 = Room("Jungle Room", 5, 50.00, song_catalogue) self.room_2 = Room("Disco Room", 10, 100.00, song_catalogue) self.room_3 = Room("Outer Space Room", 3, 30.00, song_catalogue) self.guest_1 = Guest("Gavin", 35, "Closing Time", 50.00) self.guest_2 = Guest("Ailsa", 27, "Romeo and Juliet", 45.00) self.guest_3 = Guest("Stewart", 32, "Don't Think Twice, It's Alright", 55.00) self.guest_4 = Guest("Karissa", 27, "Super Trouper", 48.00) self.guest_5 = Guest("Isla", 28, "Oops! I Did it Again", 52.00) self.guest_6 = Guest("Kirsty", 16, "What's My Age Again?", 25.00) self.drink_1 = Drink("Cocktail Pitcher", 12.00) self.drink_2 = Drink("Punk IPA", 5.00)
def read_database_drinks(list_name, credentials=CREDENTIALS): connection = pymysql.connect(**credentials) cursor = connection.cursor() cursor.execute( "SELECT drink_id, drink_name, container, volume FROM drinks") rows = cursor.fetchall() for row in rows: drink = Drink(row[1], row[2], row[3]) list_name.append(drink) cursor.close() connection.close() return list_name
def setUp(self): self.drink_01 = Drink("Gaffer's Home Brew", 5, 1.20) self.drink_02 = Drink("Dry Martini", 2, 3.40) self.drink_03 = Drink("Margarita", 2, 3.40) self.drink_04 = Drink("Manhattan", 2, 3.40) self.drink_05 = Drink("Sazerac", 3, 4.25) self.drink_06 = Drink("Highball", 1, 2.60)
def setUp(self): self.room_01 = Room("The Party Room", 4, 5.00) self.room_02 = Room("The Date Room", 2, 10.00) self.drink_01 = Drink("Gaffer's Home Brew", 5, 1.20) self.drink_02 = Drink("Dry Martini", 2, 3.40) self.drink_03 = Drink("Margarita", 2, 3.40) self.drink_04 = Drink("Manhattan", 2, 3.40) self.drink_05 = Drink("Sazerac", 3, 4.25) self.drink_06 = Drink("Highball", 1, 2.60) self.song_01 = Song("Come on Eileen", "Dexys Midnight Runners") self.song_02 = Song("Mr Blue Sky", "ELO") self.song_03 = Song("Bat out of Hell", "Meatloaf") self.song_04 = Song("You're so Vain", "Carly Simon") self.song_05 = Song("Tubthumping", "Chumbawamba") self.song_06 = Song("Accidentally in Love", "Counting Crows") self.guest_01 = Guest("Frodo Baggins", 51, 30.50, self.song_04, self.drink_06) self.guest_02 = Guest("Samwise Gamgee", 36, 10.75, self.song_03, self.drink_01) self.guest_03 = Guest("Meriadoc Brandybuck", 37, 23.60, self.song_01, self.drink_05) self.guest_04 = Guest("Peregrin Took", 29, 17.85, self.song_05, self.drink_03)
def setUp(self): self.song1 = Song("The Rolling Stones", "She's a rainbow") self.song2 = Song("The Kinks", "All day and all of the night") self.song3 = Song("The Beatles", "Norwegian Wood") self.song4 = Song("The Troggs", "Wild Thing") self.songs = [self.song1, self.song2, self.song3, self.song4] self.drink = Drink("rum", 5.00, 30) self.food = Food("peanuts", 2.00, 25) self.guest1 = Guest("Holly Golighty", 20, 50, self.song1, 4) self.guest2 = Guest("Paul Varjak", 27, 100, self.song2, 8) self.guest3 = Guest("Cat", 100, 0, self.song4, 2) self.guests = [self.guest1, self.guest2, self.guest3]
def setUp(self): self.room_1 = Room("Lizard Lounge", 3) self.room_2 = Room("Viper's Nest", 10) self.room_3 = Room("Clucking Hell", 15) room_list = [self.room_1, self.room_2, self.room_3] self.karaoke_bar = KaraokeBar("The Hit Re-Factory", room_list, 100.00, 10.00) self.drink_1 = Drink("Singha", 5.00) self.drink_2 = Drink("Cobra", 4.95) self.drink_3 = Drink("Tiger", 4.50) self.drink_4 = Drink("Blue WKD", 5.50) self.drink_5 = Drink("Red, Red Wine", 5.95) self.drink_6 = Drink("Tequila Sunrise", 8.75)
def write_drinks_db(list_name, credentials=CREDENTIALS): drinks2 = [] connection = pymysql.connect(**credentials) cursor = connection.cursor() cursor.execute( "SELECT drink_id, drink_name, container, volume FROM drinks") rows = cursor.fetchall() for row in rows: drink = Drink(row[1], row[2], row[3]) drinks2.append(drink) for drink in list_name: drink_found = False for drink_1 in drinks2: if drink.drink_name == drink_1.drink_name: drink_found = True if drink_found == False: connection = pymysql.connect(**credentials) cursor = connection.cursor() cursor.execute( f"INSERT INTO drinks (drink_name, container, volume) values ('{drink.drink_name}', '{drink.container}', '{drink.volume}')" ) connection.commit()
def read_from_file(file_name, list_name): with open(file_name, 'r+') as csvfile: new_thing = csv.reader(csvfile, delimiter= ' ') for row in new_thing: drink = Drink(row[0], row[1], row[2]) list_name.append(drink)
def setUp(self): self.drink = Drink("Beer", 5.00, 10, 2)
def setUp(self): self.drink_1 = Drink("Tennents", 3.50, True) self.drink_2 = Drink("Coca Cola", 2.00, False)
def setUp(self): self.drink = Drink("Cocktail Pitcher", 12.00)
def setUp(self): self.drink = Drink("Guiness", 3, 2)