Added test for error stanzas.

This commit is contained in:
Lance Stout 2010-10-24 19:56:42 -04:00
parent 185d7cf28e
commit 03847497cc

View file

@ -56,4 +56,21 @@ class TestErrorStanzas(SleekTest):
</message> </message>
""", use_values=False) """, use_values=False)
def testDelText(self):
"""Test deleting the text of an error."""
msg = self.Message()
msg['error']['test'] = 'Error!'
msg['error']['condition'] = 'internal-server-error'
del msg['error']['text']
self.check_message(msg, """
<message type="error">
<error type="cancel">
<internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</message>
""")
suite = unittest.TestLoader().loadTestsFromTestCase(TestErrorStanzas) suite = unittest.TestLoader().loadTestsFromTestCase(TestErrorStanzas)