def test_on_leave_after_bad_challenge(self):
            session = MockApplicationSession()
            exception = RuntimeError("such challenge")
            session.onLeave = exception_raiser(exception)
            session.onChallenge = exception_raiser(exception)
            # make a challenge (which will fail, and then the
            # subsequent onLeave will also fail)
            msg = message.Challenge(u"foo")
            session.onMessage(msg)

            self.assertEqual(2, len(session.errors))
            self.assertEqual(exception, session.errors[0][0])
onLeave raises error after onChallenge fails
dataset/ETHPy150Open crossbario/autobahn-python/autobahn/wamp/test/test_user_handler_errors.py/TestSessionCallbacks.test_on_leave_after_bad_challenge