Exemplo n.º 1
0
    def test_remove_users_success(self):
        test_room = Room(None, None)

        for test_user in USERS:
            test_room.add_user(test_user)

        test_room.remove_user(USERS[0])
        self.assertFalse(test_room.has_user(USERS[0]))
Exemplo n.º 2
0
    def test_is_creator_success(self):
        test_room = Room(None, None)
        test_room.add_user(USERS[0])
        test_room.set_creator(USERS[0])

        self.assertTrue(test_room.is_creator(USERS[0]))

        test_room.set_creator(USERS[1])
        self.assertTrue(test_room.has_user(USERS[1]))
        self.assertTrue(test_room.is_creator(USERS[1]))
Exemplo n.º 3
0
    def test_remove_users_fail(self):
        test_room = Room(None, None)
        test_room.add_user(USERS[0])

        test_room.remove_user(USERS[1])
        self.assertFalse(test_room.has_user(USERS[1]))
Exemplo n.º 4
0
    def test_add_users(self):
        test_room = Room(None, None)

        for test_user in USERS:
            test_room.add_user(test_user)
            self.assertTrue(test_room.has_user(test_user))