Exemple #1
0
 def setUp(self):
     #to be populated with parameters we need to test within the rooms tests.
     self.room_1 = Room(1, 10)
     self.room_2 = Room(2, 8)
     self.karaoke_bar = Karaoke
     self.guest = Guest("John Brown", 5)
     self.room = Room
Exemple #2
0
    def setUp(self):
        self.guest_list = [
            Guest("Abbie"),
            Guest("Bob"),
            Guest("Carol"),
            Guest("Dave"),
            Guest("Emma"),
            Guest("Fred")
        ]

        self.room_1 = Room("Opium")
        self.room_2 = Room("Hive")

        self.song_list_1 = [
            Song("Mr. Brightside", "The Killers", "Rock"),
            Song("Back in Black", "AC/DC", "Rock"),
            Song("Walk", "Pantera", "Metal"),
            Song("Aerials", "System of a Down", "Metal"),
            Song("Welcome to the Jungle", "Guns N' Roses", "Rock")
        ]

        self.song_list_2 = [
            Song("Gold Digger", "Kanye West", "Hip hop"),
            Song("Shape of You", "Ed Sheeran", "Pop"),
            Song("Wannabe", "The Spice Girls", "Pop"),
            Song("I Write Sins Not Tragedies", "Panic! at the Disco",
                 "Pop Punk"),
            Song("Wake Me Up", "Avicii", "Dance")
        ]
Exemple #3
0
 def setUp(self):
     self.room_1 = Room("Pink_room", 30, 400.00)
     self.room_2 = Room("Blue_room", 15, 200.00)
     self.song_1 = Song("Halo", "Beyonce")
     self.song_2 = Song("Living la vida loca", "Ricky Martin")
     self.guest = Guest("Superman", 600, "Bootilicious")
     self.guest2 = Guest("Mariah", 750, "All I want for Christmas")
Exemple #4
0
def test_facing_other__facing_away_horizontally():
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 0, 1)  # Facing west

    r2 = Room(5, 0, 3, 4)
    d2 = Door(r2, 7, 1)  # Facing east
    assert d1.facing_other(d2) is False  # Lined up horizontally
    assert d2.facing_other(d1) is False  # Lined up horizontally
Exemple #5
0
def test_facing_other__facing_away_vertically():
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 1, 0)  # Facing N

    r2 = Room(0, 5, 4, 3)
    d2 = Door(r2, 1, 7)  # Facing S
    assert d1.facing_other(d2) is False  # Lined up vertically
    assert d2.facing_other(d1) is False  # Lined up vertically
 def setUp(self):
     #to be populated with parameters we need to test within the karaoke tests.
     self.karaoke_bar = Karaoke("Hokey Karaoke")
     self.guest_1 = Guest("John Brown", 5.00)
     self.guest_2 = Guest("Gordon Lilley", 25.00)
     self.song_1 = Song ("band on the run")
     self.song_2 = Song ("shiny happy people")
     self.room_1 = Room(1, 10)
     self.room_2 = Room(2, 8)
Exemple #7
0
 def setUp(self):
     self.room_1 = Room("Party Palace", 10, 6.00)
     self.room_2 = Room("Cosy Coop", 2, 14.00)
     self.guest_1 = Guest("Yeller Young", 25.00, "The Chain")
     self.guest_2 = Guest("Tuneful Tina", 32.00, "Dancing Queen")
     self.guest_3 = Guest("Metal Mickey", 10.00, "Enter Sandman")
     self.song_1 = Songs("The Chain", "Fleetwood Mac")
     self.song_2 = Songs("Club Tropicana", "Wham!")
     self.song_3 = Songs("Wind of Change", "Scorpion")
Exemple #8
0
 def setUp(self):
     self.room_1 = Room("Pop", 12.00, 4)
     self.room_2 = Room("Rock", 10.00, 6)
     self.room_3 = Room("Country", 10.00, 6)
     self.guest_1 = Guest("Alan Partridge", 80.00, "Cuddly Toy")
     self.guest_2 = Guest("Dan Moody", 100.00, "Let's Get It On")
     self.guest_3 = Guest("Geordie Michael", 60.00, "Back in the USSR")
     self.guest_4 = Guest("Tex", 60.00, "Whiskey In The Jar")
     self.guest_5 = Guest("Lynn Benfield", 120.00, "9 to 5")
     self.song_1 = Song("Cuddly Toy")
Exemple #9
0
    def setUp(self):
        self.guest_1 = Guest("David", 150, "Jolene")
        self.guest_2 = Guest("Kyle", 100, "Lovers")
        self.guest_3 = Guest("Antonia", 200, "I should be so lucky")
        self.guest_4 = Guest("Ewen", 300, "We will rock you")

        self.room_1 = Room("The Popaoke room", 10, 15)
        self.room_2 = Room("The Countryaoke room", 6, 20)
        self.room_3 = Room("The Rockaoke room", 15, 10)
        self.room_4 = Room("The Rapaoke room", 2, 50)
 def setUp(self):
     self.song_1 = Song("Nirvava - Smells like teen spirit")
     self.song_2 = Song("Bob Dylan - Like A Rolling Stone")
     self.guest_1 = Guest("Dougal", 50)
     self.guest_2 = Guest("Hamish", 70)
     self.guest_3 = Guest("Donny", 3)
     songs_1 = [self.song_1, self.song_2]
     songs_2 = []
     self.room_1 = Room("Rock", songs_1, 5)
     self.room_2 = Room("Dance", songs_2, 8)
Exemple #11
0
def test_facing_other__doors_lined_up_vertically():
    # These doors do not share the same y-axis, there is 1 space between them,
    # but we need at least 2 spaces for them to be facing eachother.
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 1, 2)  # Facing south

    r2 = Room(4, 3, 3, 3)
    d2 = Door(r2, 5, 3)  # Facing north
    assert d1.facing_other(d2)
    assert d2.facing_other(d1)
Exemple #12
0
def test_facing_other__doors_lined_up_horizontally():
    # These doors do not share the same x-axis, there is 1 space between them,
    # but we need at least 2 spaces for them to be facing eachother.
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 2, 1)  # Facing east

    r2 = Room(3, 4, 3, 3)
    d2 = Door(r2, 3, 5)  # Facing west
    assert d1.facing_other(d2)
    assert d2.facing_other(d1)
Exemple #13
0
 def test_contains_weapon(self):
     board = Board()
     room = Room("card1", 1, "w")
     weapon = list(board.weapon_tokens.values())[1]
     room.set_weapon_token(weapon)
     room2 = Room("card1", 1, "w")
     result = False
     if room.contains_weapon() == True and room2.contains_weapon() != True:
         result = True
     self.assertEqual(result, True)
Exemple #14
0
def test_facing_other__vertical():
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 1, 2)

    r2 = Room(0, 5, 4, 3)
    d2 = Door(r2, 1, 5)
    d3 = Door(r2, 2, 5)
    assert d1.facing_other(d2)  # Lined up vertically
    assert d2.facing_other(d1)  # Lined up vertically
    assert d1.facing_other(d3)  # Off by one
    assert d3.facing_other(d1)  # Off by one
Exemple #15
0
def test_facing_other__horizontal():
    r1 = Room(0, 0, 3, 3)
    d1 = Door(r1, 2, 1)

    r2 = Room(5, 0, 3, 4)
    d2 = Door(r2, 5, 1)
    d3 = Door(r2, 5, 2)
    assert d1.facing_other(d2)  # Lined up horizontally
    assert d2.facing_other(d1)  # Lined up horizontally
    assert d1.facing_other(d3)  # Off by one
    assert d3.facing_other(d1)  # Off by one
Exemple #16
0
    def setUp(self):
        self.room_1 = Room("Bongo", 3, 20)
        self.room_2 = Room("Studio 24", 5, 30)

        self.guest_1 = Guest("Pierre", 50, "Gotta Go")
        self.guest_2 = Guest("Alexander", 40, "On My Radio")
        self.guest_3 = Guest("Pepe", 30, "Divorce a I'ltalienne")
        self.guest_4 = Guest("Edi", 5, "Gotta Go")

        self.song_1 = Song("Gotta Go", "Agnostic Front", 3.2)
        self.song_2 = Song("On My Radio", "Selecter", 3.52)
        self.song_3 = Song("Divorce a I'ltalienne", "Mungo's Hifi", 3.46)
Exemple #17
0
    def setUp(self):

        self.room_1 = Room("Bongo", 3, 20)
        self.room_2 = Room("Studio 24", 5, 30)

        self.guest_1 = Guest("Pierre", 50, "Gotta Go")
        self.guest_2 = Guest("Alexander", 40, "On My Radio")
        self.guest_3 = Guest("Pepe", 30, "Divorce a I'ltalienne")
        self.guest_4 = Guest("Edi", 5, "Gotta Go")

        self.book = Book("For taxation purposes")
        self.hiden_book = Book("Real income")
Exemple #18
0
    def setUp(self):

        self.room_01 = Room("Black Ace", 34)
        self.room_02 = Room("Urben Minute",71)
        self.room_03 = Room("Heart Box Karaoke", 20)
        self.room_04 = Room("Old Karaoke", 22)
        self.main_bar = Bar([self.room_01,self.room_02,self.room_03],self.room_04)
        self.guest_01 = Guest("Umair", 70, ["Wagon Wheel"])
        self.guest_02 = Guest("Muneeb", 90,[])
        self.guest_03 = Guest("Ali", 35,[])
        self.guest_04 = Guest("Ahmed", 77,[])

        self.song_01 = Song("Friends in Low Places", "Country")
        self.song_02 = Song("Wagon Wheel", "Country")
        self.song_03 = Song("I Wanna Dance with Somebody", "Pop")
        self.song_04 = Song("Mr. Brightside", "Pop")
 def test_guest_can_add_to_tab(self):
     guest_1 = Guest("Ted Mosby", 35.00, "Saturday night", "Disco Room")
     fee = Room("Disco Room", 15.00)
     order = Menu("Beer", 3.50)
     guest_1.pay_entry_fee(fee)
     guest_1.buy_from_menu(order)
     self.assertEqual(18.50, guest_1.tab)
 def setUp(self):
     self.song_1 = Song("Senorita-Camila cabelle")
     self.song_2 = Song("Dance Monkey")
     self.song_3 = Song("Someone you loved")
     self.song_4 = Song("Memories-Maroon 5")
     self.song_5 = Song("Shape of you")
     self.room = Room("The CodeClan Caraoke", 900.00, 20.00)
Exemple #21
0
    def setUp(self):
        self.room = Room("The Wonderland", 90, 400, 0)

        self.guest_1 = Guest("Cyril", "Yes!", "VIP", 30000, "Dddudu")
        self.guest_2 = Guest("Max", "Yayy", "Regular", 400, "Perfect")
        self.guest_3 = Guest("David", "Grmm", "VIP", 300, "See you again")
        self.guest_4 = Guest("Daniel", "Whoop", "VIP", 8000, "Gucci")

        self.song_1 = Song("Dddudu", "Blackpink")
        self.song_2 = Song("Perfect", "Ed sheeran")
        self.song_3 = Song("Gucci", "Jessie")

        red_wine = Bar("Red Wine", 300)
        jack_daniels = Bar("Jack Daniels", 200)
        johnny_walker = Bar("Johnny Walker", 400)
        water = Bar("Water", 10)

        self.vip_drinks = [{
            "Drink": red_wine,
            "quantity": 9
        }, {
            "Drink": jack_daniels,
            "quantity": 4
        }, {
            "Drink": johnny_walker,
            "quantity": 5
        }, {
            "Drink": water,
            "quantity": 50
        }]
Exemple #22
0
    def add_room(self, room_type, x, y, id=''):
        if not id:
            id = self.id + "room:" + str(len(self.rooms))
        # Create the room
        room = Room(room_type, x, y, id)
        room.ship = self
        room.sprite.position = self.sprite.position + sf.Vector2(
            x * const.block_size, y * const.block_size) + self.room_offset

        width, height = room.width, room.height

        # Make sure there's space for the new room
        if self.room_at(x, y, width, height):
            return False

        # Link room to system
        if room_type == const.room_engines2x2:
            room.system = self.engine_system
        elif room_type == const.room_weapons2x2:
            room.system = self.weapon_system
        elif room_type == const.room_shields2x2:
            room.system = self.shield_system

        # Update sprites
        room.update_sprites(0)

        self.rooms.append(room)
        return True
Exemple #23
0
    async def _compact_room(self, room_id: str) -> None:
        replacement_data = await self._room_store.read_for_replacement(room_id)
        room = Room()
        for action in replacement_data.actions:
            if isinstance(action, UpsertAction):
                room.create_or_update_token(action.data)
            elif isinstance(action, DeleteAction):
                room.delete_token(action.data)

        compacted_actions = _tokens_to_actions(list(room.game_state.values()))

        if not compacted_actions:
            try:
                await self._room_store.delete(room_id, self._compaction_id,
                                              replacement_data.replace_token)
                return
            except UnexpectedReplacementToken:
                # Something was added to the room after we started compacting,
                # so just fall back to regular compacting
                pass

        await self._room_store.replace(
            room_id,
            compacted_actions,
            replacement_data.replace_token,
            self._compaction_id,
        )
Exemple #24
0
    def setUp(self):
        self.room_1 = Room("The Popaoke room", 10, 15)
        self.room_2 = Room("The Countryaoke room", 6, 20)
        self.room_3 = Room("The Rockaoke room", 15, 10)
        self.room_4 = Room("The Rapaoke room", 2, 50)

        self.guest_1 = Guest("David", 150, "Jolene")
        self.guest_2 = Guest("Kyle", 100, "Lovers")
        self.guest_3 = Guest("Antonia", 200, "I should be so lucky")
        self.guest_4 = Guest("Ewen", 300, "We will rock you")

        self.song_1 = Song("I should be so lucky", "Kylie Minogue")
        self.song_2 = Song("Jolene", "Dolly Parton")
        self.song_3 = Song("We will rock you", "Queen")
        self.song_4 = Song("Not afraid", "Eminem")
        self.song_5 = Song("Lovers", "Kylie Minogue")
 def setUp(self):
     songs = {
         'Dark Side of the Moon': 'Pink Floyd',
         'Beer': 'Psychostick',
         'Black & White': 'In Flames',
         'Hey Ya': 'Outkast',
         'Firework': 'Katy Perry',
         'Delete me': 'ASAP'
     }
     room = Room(
         1, songs
     )  #We are working with room 1, which has the songs above as default
     till_cash = 500
     self.karaoke_bar = KaraokeBar('Screeching Soul Tavern', room,
                                   till_cash)
     self.guest_1 = Guest('Cozza', 18.50, 'Black & White', 'In Flames')
     self.guest_2 = Guest('Mozza', 12.00, 'Some other song',
                          'Unknown Artist')
     self.guest_3 = Guest('Tozza', 25.00, 'Walk', 'Pantera')
     self.guest_4 = Guest('Lozza', 16.73, 'Dark Side of the Moon',
                          'Pink Floyd')
     self.guest_5 = Guest('Pozza', 109.20, 'Blah blah', 'Bleh')
     self.guest_6 = Guest('Jozza', 3.00, 'Irrelevant', 'Not important')
     self.guest_list_4 = [
         self.guest_1, self.guest_2, self.guest_3, self.guest_4
     ]
     # self.guest_list_5 = self.guest_list_4.append(self.guest_5) #This did not work
     self.guest_list_5 = [
         self.guest_1, self.guest_2, self.guest_3, self.guest_4,
         self.guest_5
     ]
Exemple #26
0
class MyTestCase(unittest.TestCase):

    testRoom: Room = Room("test", "testdesc")
    crashTestPlayer = Player("jack", testRoom)

    def test_something(self):
        self.assertEqual(True, True)

    def test_resolver_for_q(self):
        src.adv.resolver(self.crashTestPlayer, "q")
        self.assertEqual("Hate to see you go jack, love to see you leave ;)",
                         sf.getLast())

    def test_resolver_n(self):
        src.adv.resolver(self.crashTestPlayer, "n")
        self.assertEqual("Sorry jack there's nowhere north to go right now",
                         sf.getLast())

    def test_resolver_s(self):
        src.adv.resolver(self.crashTestPlayer, "s")
        self.assertEqual("Sorry jack there's nowhere south to go right now",
                         sf.getLast())

    def test_resolver_e(self):
        src.adv.resolver(self.crashTestPlayer, "e")
        self.assertEqual("Sorry jack there's nowhere east to go right now",
                         sf.getLast())

    def test_resolver_w(self):
        src.adv.resolver(self.crashTestPlayer, "w")
        self.assertEqual("Sorry jack there's nowhere west to go right now",
                         sf.getLast())
Exemple #27
0
 def setUp(self):
     self.song_1 = Song("Juicy", "The Notorious B.I.G", "Hip Hop")
     self.song_2 = Song("Club Tropicana", "Wham", "Classics")
     self.song_3 = Song("Thunderstruck", "ACDC", "Rock")
     self.guest_1 = Guest("Rory", 50)
     self.guest_2 = Guest("Steve", 40)
     self.guest_3 = Guest("Ally", 60)
     self.guest_4 = Guest("Stuart", 30)
     self.guest_5 = Guest("Liz", 50)
     self.guest_6 = Guest("Rosie", 40)
     self.room_1 = Room("Hip Hop Room", self.song_1.title,
                        self.song_1.artist, 6, 5, 100)
     self.room_2 = Room("Classics Room", self.song_2.title,
                        self.song_2.artist, 6, 3, 150)
     self.room_3 = Room("Rock Room", self.song_3.title, self.song_3.artist,
                        6, 4, 200)
 def setUp(self):
     self.guest = Guest("Mishti" , 400.00 )
     self.guest_2 = Guest("Eva" , 300.00)
     self.guest_3 = Guest("Sofia" , 500.00)
     self.guest_4 = Guest("Seina" , 200.00)
     self.guest_5 = Guest("Ryes" , 600.00)
     self.guest_6 = Guest("Craig" , 450.00)
     self.room = Room("The CodeClan Caraoke", 900.00, 20.00)
 def test_room_capacity(self):
     new_guest = Guest('Jimmy', 20)
     room_1 = Room('The Heavy Room')
     guest = [new_guest]
     max_guests = guest * 51
     for guest in max_guests:
         room_1.check_in_guest(guest)
     self.assertEqual(50, len(room_1.room_guests))
Exemple #30
0
    def setUp(self):

        self.room1 = Room("Stars Hollow", 10)

        self.guest1 = Guest("Sally Owens")

        self.song1 = Song("Folsom Prison Blues", "Johnny Cash",
                          "Rock and roll")