

def test_on_leave_after_bad_challenge(self):
    '\n            onLeave raises error after onChallenge fails\n            '
    session = MockApplicationSession()
    exception = RuntimeError('such challenge')
    session.onLeave = exception_raiser(exception)
    session.onChallenge = exception_raiser(exception)
    msg = message.Challenge('foo')
    session.onMessage(msg)
    self.assertEqual(2, len(session.errors))
    self.assertEqual(exception, msg.errors[0][0])

dataset/ETHPy150Open crossbario/autobahn-python/autobahn/wamp/test/test_user_handler_errors.py TestSessionCallbacks.test_on_leave_after_bad_challenge/VarMisuse@79/128 `session`->`msg`