

def test_no_session(self):
    '\n            test "all other cases" when we don\'t yet have a session\n            established, which should all raise ProtocolErrors and\n            *not* go through the onUserError handler. We cheat and\n            just test one.\n            '
    session = MockApplicationSession()
    exception = RuntimeError('such challenge')
    session.onConnect = exception_raiser(exception)
    for msg in [message.Goodbye()]:
        self.assertRaises(ProtocolError, session.onMessage, (msg,))
    self.assertEqual(0, len(session.errors))

dataset/ETHPy150Open crossbario/autobahn-python/autobahn/wamp/test/test_user_handler_errors.py TestSessionCallbacks.test_no_session/original