def test_from_exception(self): exc = errors.XMPPWaitError( condition=errors.ErrorCondition.ITEM_NOT_FOUND, text="foobar") obj = stanza.Error.from_exception(exc) self.assertEqual(structs.ErrorType.WAIT, obj.type_) self.assertEqual(errors.ErrorCondition.ITEM_NOT_FOUND, obj.condition) self.assertEqual("foobar", obj.text)
def test_from_exception(self): exc = errors.XMPPWaitError(condition=(namespaces.stanzas, "item-not-found"), text="foobar") obj = stanza.Error.from_exception(exc) self.assertEqual(structs.ErrorType.WAIT, obj.type_) self.assertEqual((namespaces.stanzas, "item-not-found"), obj.condition) self.assertEqual("foobar", obj.text)