def setUp(self): self.guest = Guest("John Travolta", 34, 50, "Saturday Night Fever") self.guest_2 = Guest("Cyndi Lauper", 50, 60, "Girls just wanna have fun") self.guest_3 = Guest("Bob Dylan", 20, 35, "Blowin in the wind") self.guest_4 = Guest("Tom Jones", 26, 80, "It's not unusual") self.guest_5 = Guest("Dizzee Rascal", 31, 200, "Bonkers") self.guest_6 = Guest("Beyonce", 19, 40, "If I were a boy") self.song = Song("Saturday Night Fever", "The Bee Gees", 3.22) self.song_2 = Song("Girls just wanna have fun", "Cyndi Lauper", 2.58) self.song_3 = Song("Blowin in the wind", "Bob Dylan", 4.15) self.song_4 = Song("It's not unusual", "Tom Jones", 3.42) self.song_5 = Song("Bonkers", "Dizzee Rascal", 3.12) self.song_6 = Song("If I were a boy", "Beyonce", 4.11) self.example_room_1 = Room("stars in your eyes", 5, self.guest, self.song, [], []) self.example_room_2 = Room("Britains Got Talent", 4, self.guest, self.song, ["John Travolta", "Cyndi Lauper"], []) self.example_room_3 = Room("The Voice", 4, self.guest, self.song, ["John Travolta", "Cyndi Lauper", "Dizzee Rascal", "Beyonce"], [{ "title": "Saturday Night Fever", "Artist": "The Bee Gees", "length": 3.22, }, { "title": "Girls just wanna have fun", "Artist": "Cyndi Lauper", "length": 2.58, }, { "title": "Blowin in the wind", "Artist": "Bob Dylan", "length": 4.15 } ])
def setUp(self): self.guest = Guest("Callum", 10.00, {"Crystal Lake": "Disobey"}) self.guest_2 = Guest("James", 4.00, {"Currents": "Second Skin"}) self.guest_3 = Guest("Grant", 50.00, {"Bad Omens": "Dethrone"}) self.room = Room(1, 4, 5.00) self.room_2 = Room(1, 6, 10.00)
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): # 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.guest_1 = Guest("Colin the Crooner", 34.23, "Isn't it Pythonic?") 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)
def setUp(self): self.room1 = Room("Room 1", 2, 5) self.room2 = Room("Room 2", 3, 7.5) self.guest1 = Guest("Sam", 5) self.guest2 = Guest("Bob", 10) self.guest3 = Guest("Joe", 15) self.song1 = Song("People Like Us") self.song2 = Song("Waterloo") self.song3 = Song("Ice Cream")
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 setUp(self): self.room_1 = Room("Karaoke Star", 50) self.room_2 = Room("Karaoke Rooms", 20) self.room_3 = Room("Scotland's got talent", 10) self.guest_1 = Guest("Arnold") self.guest_2 = Guest("John") self.guest_3 = Guest("Tamara") self.song_1 = Song("Hotel California", "Eagles", "rock") self.song_2 = Song("Viva Las Vegas", "Elvis Presley", "Rock and roll") self.song_3 = Song("Billie Jean", "Michael Jackson", "Pop")
def setUp(self): self.room = Room("Cover Your Ears!", 15, 10) self.room_small = Room("Tight Squeeze", 1, 15) self.song = Song("Hold a chicken in the air") self.song_not_fav = Song("Put that chair back") # fav_song should be song object, not just a string self.guest = Guest("Sid The Sloth", 33.25, "Hold a chicken in the air") # like... # self.guest = Guest("Sid The Sloth", 33.25, song) # fav_song should be song object, not just a string self.guest_no_money = Guest("Scrooge", 3.99, "Yeah, right!")
def setUp(self): # Menu self.menu = [{ "name": "Ya Danger", "price": 9.00, "ingredients": ["Hendrick’s Orbium", "Fino", "Queen Olive", "Pineapple"] }] # Bar self.bar_tab_01 = BarTab("Cocktail Bar", self.menu, {}) # Rooms self.room_01 = Room("Rock Room", 5, 10.00, [], [], self.bar_tab_01) self.room_02 = Room("Reggae Room", 4, 12.00, [], [], self.bar_tab_01) self.room_03 = Room("\'80s Room", 6, 15.00, [], [], self.bar_tab_01)
def setUp(self): self.song = Song("Clint Eastwood", "Gorrilaz", "Electropop") self.song2 = Song("All Eyez On Me", "Tupac", "Rap") self.song3 = Song("Timeless", "Il Divo", "Classical") self.song4 = Song("Hurt", "Johnny Cash", "Country") self.song5 = Song("Mustang Sally", "Wilson Pinkett", "Blues") self.song6 = Song("Think Twice", "Celine Dion", "Soft Rock") self.song7 = Song("Bye Bye", "Mariah Carey", "R&B") self.song8 = Song("Perfect", "Ed Sheeran", "Pop") self.guest = Guest("Frank Samson", 50.00, 30, self.song) self.room = Room("300", 30.00, 0, [self.song, self.song2]) self.room2 = Room("301", 25.00, 1, [self.song3, self.song4]) self.room3 = Room("302", 20.00, 1, [self.song5, self.song6]) self.room4 = Room("303", 30.00, 0, [self.song7, self.song8])
def setUp(self): self.room1 = Room("Boiler room", 20, 5) self.room2 = Room("Grinder room", 35, 3) self.guest = Guest("Jack", 28, 50.00, "In the end") self.guest1 = Guest("Andy", 35, 75.00, "In the end") self.guest2 = Guest("Alex", 25, 30.00, "Unwritten") self.guest3 = Guest("Collin", 30, 45.00, "Dancing in the moonlight") self.guests1 = [self.guest, self.guest1, self.guest2] self.guests2 = [self.guest, self.guest1, self.guest2, self.guest3] self.guests3 = [self.guest1, self.guest2, self.guest3] self.song = Song("Queen", "Bohemian Rhapsody") self.song1 = Song("Linken park", "In the end") self.song2 = Song("Natasha Bedingfield", "Unwritten") self.song4 = Song("Top Loader", "Dancing in the moonlight") self.playlist = [self.song, self.song1, self.song2]
def setUp(self): self.room = Room("Room 1", 45, "Wild West") self.guest_1 = Guest("Michael Jackson", 50) self.guest_2 = Guest("50 Cent", 150) self.song_1 = Song("Beautiful Day", "U2") self.song_2 = Song("Bunsen", "Frontierer") self.song_3 = Song("Axe To Fall", "Converge")
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): self.guest1 = Guest("Stevie", 39, "The Chain", 10) self.guest2 = Guest("Luke", 45, "The Rocky Road to Dublin", 150) self.guest3 = Guest("Cathy", 31, "Wuthering Heights", 20) # self.room1 = Room("Osaka", 5, 20) self.room = Room("Tokyo", 3, 20)
async def create_room( room_info: RoomCreationRequest, email: str = Depends(valid_credentials), username: str = Depends(get_username_from_token)): """ Endpoint for creating a new room. Possible respones:\n 201 when succesfully created. 401 when not logged in. 403 when email not confirmed. 409 when the room name is already in use. 500 when there's an internal error in the database. """ room_name = room_info.name max_players = room_info.max_players email_confirmed = await check_email_status(email) if not email_confirmed: raise HTTPException(status_code=403, detail="E-mail not confirmed") elif room_name in (hub.all_rooms()): raise HTTPException(status_code=409, detail="Room name already in use") else: new_room = Room(room_name, max_players, username) await save_game_on_database(new_room) hub.add_room(new_room) return {"message": "Room created successfully"}
def load_from_database(): db_rooms = [] try: with db_session: db_rooms += db.DB_Room.select() except Exception as e: print(e) rooms = [] for room in db_rooms: new_room = Room(room.name, room.max_players, room.owner) new_room.users = room.users["users"] new_room.emails = room.emails["emails"] if room.status == RoomStatus.PREGAME.value: new_room.set_status(RoomStatus.PREGAME) elif room.status == RoomStatus.IN_GAME.value: new_room.set_status(RoomStatus.IN_GAME) else: new_room.set_status(RoomStatus.FINISHED) if (new_room.get_status() != RoomStatus.PREGAME and room.game is not {}): new_room.game = Game(new_room.get_user_list()) new_room.game.build_from_json(room.game) rooms.append(new_room) return rooms
def setUp(self): self.room = Room("Karoke Room 1", "Saviour", 0, 3, 2) self.guest_1 = Guest("Baron Von Humperdink", 25, 40, "Saviour") self.guest_2 = Guest("Baron Von Jon", 45, 40, "Faith Alone") self.guest_3 = Guest("Baron Steve", 65, 40, "Blitzkrieg Bop") self.song_1 = Song("Saviour", "Rise Against") self.song_2 = Song("Blitzkrieg Bop", "Ramones") self.song_3 = Song("Faith Alone", "Bad Religion")
def setUp(self): self.guest1 = Guest("Kamil", 50) self.song1 = Song("Crazy in Love", "Beyonce") self.song2 = Song("Vogue", "Madonna") songs = [self.song1, self.song2] self.room = Room(1, 8, 50)
def setUp(self): self.guest_1 = Guest("Eddie Vedder", "The Wrong Car", 500) self.guest_2 = Guest("Kurt Cobain", "Teen Spirit", 300) self.guest_3 = Guest("Billy Corgan", "1979", 500) self.guest_4 = Guest("Chris Cornell", "The Day I Tried To Live", 385) self.guest_5 = Guest("Zack De la Rocha", "Testify", 500) self.guest_6 = Guest("Chino Moreno", "Change In the House of Flies", 350) self.room_1 = Room("Yellow Submarine", 8, 50) self.room_2 = Room("Purple Rain", 10, 60) self.room_3 = Room("Blue Monday", 12, 70) self.song_1 = Song("Tether", "Chvrches", "Synth Pop") self.song_2 = Song("Questions and Answers", "Biffy Clyro", "Alt Rock") self.song_3 = Song("The Wrong Car", "The Twilight Sad", "Post Punk") self.song_4 = Song("Fast Blood", "Frightened Rabbit", "Indie Folk") self.song_5 = Song("Scottish Fiction", "Idlewild", "Indie")
def setUp(self): self.room = Room("Room 1", 3, 5.00, 100.00) self.song_1 = Song("Africa", "Toto") self.song_2 = Song("Purple Rain", "Prince") self.song_3 = Song("Dancing Queen", "Abba") self.guest_1 = Guest("Elton", 30.00, "Purple Rain") self.guest_2 = Guest("Dolly", 40.00, "Wannabe") self.guest_3 = Guest("Kylie", 50.00, "Africa") self.guest_4 = Guest("Bruce", 50.00, "Enter Sandman")
def start(self): print """ %s You wake up in a strange place... You don't have a memory of this place... %s """ % ("*" * 40, "*" * 40) while self.finished is False: currentRoom = Room() self.path.append(currentRoom) self.enterRoom(currentRoom)
def setUp(self): # self.room1 = Room("Osaka", 5, 20) self.room = Room("Tokyo", 3, 20) self.song1 = Song("Fleetwood Mac", "The Chain") self.song2 = Song("Dubliners", "The Rocky Road to Dublin") self.song3 = Song("Kate Bush", "Wuthering Heights") self.guest1 = Guest("Stevie", 39, "The Chain", 10) self.guest2 = Guest("Luke", 45, "The Rocky Road to Dublin", 150) self.guest3 = Guest("Cathy", 31, "Wuthering Heights", 200)
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 setUp(self): self.song1 = Song("Help", "The Beatles") self.song2 = Song("Saturday Night", "Sam Cooke") self.songs = [self.song1, self.song2] self.guest1 = Guest("Hannah") self.guest2 = Guest("Louise") self.guest3 = Guest("Harry") self.guests = [self.guest1, self.guest2, self.guest3] self.room = Room("Motown", 3)
def setUp(self): self.example_guest_1 = Guest("John Travolta", 34, 50, "Saturday Night Fever") self.example_guest_2 = Guest("Cyndi Lauper", 50, 60, "Girls just wanna have fun") self.example_guest_3 = Guest("Bob Dylan", 20, 35, "Blowin in the wind") self.example_guest_4 = Guest("Tom Jones", 26, 80, "It's not unusual") self.example_guest_5 = Guest("Dizzee Rascal", 31, 200, "Bonkers") self.example_guest_6 = Guest("Beyonce", 19, 4, "If I were a boy") self.example_song_1 = Song("Saturday Night Fever", "The Bee Gees", 3.22) self.example_room_1 = Room("stars in your eyes", 5, self.example_guest_1, self.example_song_1, [], [])
def setUp(self): self.room = Room("The Viper Room", 150, 5, 20) 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.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.song_1 = Song("Highway to Hell", "AC/DC") self.song_2 = Song("The Clansman", "Iron Maiden") self.song_3 = Song("Ace of Spades", "Motorhead") self.songs = [self.song_1, self.song_2, self.song_3] self.jack = Guest("Jack", 20, self.song_1) self.victor = Guest("Victor", 15, self.song_2) self.isa = Guest("Isa", 100, self.song_3) self.guests = [self.jack, self.victor, self.isa] self.winston = Guest("Winston", 10, self.song_2) self.room = Room("The Metal Room", 3, 10)
def setUp(self): # Set up song and room objecs self.guest = Guest("Santa") self.guest1 = Guest("Emma") self.guest2 = Guest("Simon") self.guest3 = Guest("Anthony") self.guest4 = Guest("Lauchy") self.song = Song("Always look on the bright side of life", "Monty Python") self.song1 = Song("Bohemian Rhapsody", "Queen") self.song2 = Song("Can't get you out of my head", "Kylie Minogue") self.song3 = Song("I wanna dance with sombody", "Whitney Houston") self.song4 = Song("Build me up buttercup", "The Foundations") self.song5 = Song("Achy breaky heart", "Billy Ray Sirus") self.song6 = Song("Baggy Trousers", "Madness") self.song7 = Song("I believe in a thing called love", "The Darkness") self.song8 = Song("Video games", "Lana Del Rey") self.song9 = Song("Hurt", "Christina Aguilera") self.song10 = Song("Let it go", "Frozen") self.song11 = Song("Shake it off", "Taylor Swift") self.song12 = Song("Baby shark", "Pink Fong") # Set up playlist for rooms self.room1_playlist = [self.song1, self.song2] self.room2_playlist = [self.song4, self.song5] self.room3_playlist = [self.song7, self.song8] self.room4_playlist = [self.song10, self.song11] self.room1 = Room("Popular Songs", self.room1_playlist, [], self.song, self.guest) self.room2 = Room("Easy Songs", self.room2_playlist, [self.guest2, self.guest3], self.song, self.guest) self.room3 = Room("Hard Songs", self.room3_playlist, [], self.song, self.guest) self.room4 = Room("Kids Songs", self.room4_playlist, [], self.song, self.guest)
def setUp(self): self.room_1 = Room("Lizard Lounge", 3) self.guest_1 = Guest("Colin the Crooner", 34.23, "Isn't it Pythonic?") self.guest_2 = Guest("Sadie the Screamer", 62.89, "Computer Love") self.guest_3 = Guest("Tuneless Wanda", 29.99, "Don't Fear the Repo") self.guest_4 = Guest("Robin the Rocker", 9.34, "Together in Electric Dreams") self.song_1 = Song("Isn't it Pythonic?", "Alanis Morissette") self.song_2 = Song("Little Red Rooster", "Jimi Hendrix") self.song_3 = Song("Computer Love", "Kraftwerk") self.song_4 = Song("Don't Fear the Repo", "Blue Oyster Cult") self.song_5 = Song("Go Your Own Way", "Fleetwood MacBook") self.song_6 = Song("MySQL", "The Temptations") self.song_7 = Song("Let's Make Love and Listen to Death from Above", "CSS")