'Test legacy operations of exceptionFromStanza.
Given a realistic stanza with only legacy (pre-XMPP) error information,
check if a sane exception is returned.
Using this stanza::
<message type=\'error\'
to=\'piers@pipetree.com/Home\'
from=\'qmacro@jaber.org\'>
<body>Are you there?</body>
<error code=\'502\'>Unable to resolve hostname.</error>
</message>'

def test_legacy(self):

    stanza = domish.Element((None, 'stanza'))
    p = stanza.addElement('body', content=u'Are    you    there?')
    e = stanza.addElement('error', content=u'Unable    to    resolve    hostname.')
    e['code'] = '502'
    result = error.exceptionFromStanza(stanza)
    self.assertIsInstance(result, error.StanzaError)
    self.assertEqual('service-unavailable', result.condition)
    self.assertEqual('wait', result.type)
    self.assertEqual('Unable    to    resolve    hostname.', result.text)
    self.assertEqual([p], result.children)
