def test_basic(self):

        stanza = domish.Element((None, 'stanza'))
        p = stanza.addElement(('http://jabber.org/protocol/pubsub', 'pubsub'))
        p.addElement('subscriptions')
        e = stanza.addElement('error')
        e['type'] = 'cancel'
        e.addElement((NS_XMPP_STANZAS, 'feature-not-implemented'))
        uc = e.addElement(('http://jabber.org/protocol/pubsub#errors',
                           'unsupported'))
        uc['feature'] = 'retrieve-subscriptions'

        result = error.exceptionFromStanza(stanza)
        self.assert_(isinstance(result, error.StanzaError))
        self.assertEquals('feature-not-implemented', result.condition)
        self.assertEquals('cancel', result.type)
        self.assertEquals(uc, result.appCondition)
        self.assertEquals([p], result.children)
Test basic operations of exceptionFromStanza.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/test/test_jabbererror.py/ExceptionFromStanzaTest.test_basic