Exemple #1
0
 def test_room_add_owner(self):
     r = Room()
     r.open()
     o = User()
     r.add_owner(o)
     self.assertEqual(len(r.users), 1)
     self.assertEqual(o, r.owner)
Exemple #2
0
 def test_remove_user(self):
     r = Room()
     r.open()
     u1 = User()
     u2 = User()
     r.add_user(u1)
     r.add_user(u2)
     self.assertIn(u1, r.users)
     r.remove_user(u1)
     self.assertNotIn(u1, r.users)
     self.assertIn(u2, r.users)
Exemple #3
0
 def test_close_room(self):
     r = Room()
     r.open()
     u1 = User()
     u2 = User()
     o = User()
     r.add_user(u1)
     r.add_user(u2)
     r.add_owner(o)
     r.close()
     self.assertFalse(r.is_open())
     self.assertEqual(len(r.users), 0)
     self.assertEqual(r.owner, o)
Exemple #4
0
 def test_room_add_user(self):
     r = Room()
     r.open()
     u = User()
     r.add_user(u)
     self.assertEqual(len(r.users), 1)
Exemple #5
0
 def test_open_room(self):
     r = Room()
     r.open()
     self.assertTrue(r.is_open())