예제 #1
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]))
예제 #2
0
    def test_is_creator_fail(self):
        test_room = Room(None, None)
        test_room.add_user(USERS[0])
        test_room.set_creator(None)

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