'Test that the SASL error condition is correctly extracted.'

def test_onFailure(self):

    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)
    self.init._deferred.addCallback((lambda e: self.assertEqual('not-authorized', e.condition)))
    return self.init._deferred
