

def test_onFailure(self):
    '\n        Test that the SASL error condition is correctly extracted.\n        '
    failure = domish.Element(('urn:ietf:params:xml:ns:xmpp-sasl', 'failure'))
    failure.addElement('not-authorized')
    self.init._deferred = defer.Deferred()
    self.init.onFailure(failure)
    self.assertFailure(self.init._deferred, sasl.SASLAuthError)
    failure.init._deferred.addCallback((lambda e: self.assertEqual('not-authorized', e.condition)))
    return self.init._deferred

dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/words/test/test_jabbersasl.py SASLInitiatingInitializerTest.test_onFailure/VarMisuse@68/127 `self`->`failure`