Ejemplo n.º 1
0
 def test_leave(self):
     session = Session(Config())
     session.join(User('test'))
     self.assertEqual(1, len(session.users))
     session.join(User('test1'))
     self.assertEqual(2, len(session.users))
     session.leave(User('test'))
     self.assertEqual(1, len(session.users))
Ejemplo n.º 2
0
 def test_leave(self):
     session = Session(Config())
     session.join(User('test'))
     self.assertEqual(1, len(session.users))
     session.join(User('test1'))
     self.assertEqual(2, len(session.users))
     session.leave(User('test'))
     self.assertEqual(1, len(session.users))
Ejemplo n.º 3
0
 def test_finished(self):
     session = Session(Config())
     self.assertEqual(session.finished, False)
     session.join(User('test'))
     session.finish()
     self.assertEqual(session.finished, True)
     with self.assertRaises(SessionFinished):
         session.finish()
     with self.assertRaises(SessionFinished):
         session.join(object())
     with self.assertRaises(SessionFinished):
         session.leave(object())
Ejemplo n.º 4
0
 def test_finished(self):
     session = Session(Config())
     self.assertEqual(session.finished, False)
     session.join(User('test'))
     session.finish()
     self.assertEqual(session.finished, True)
     with self.assertRaises(SessionFinished):
         session.finish()
     with self.assertRaises(SessionFinished):
         session.join(object())
     with self.assertRaises(SessionFinished):
         session.leave(object())