Permalink
Browse files

Added test for error stanzas.

  • Loading branch information...
1 parent 185d7cf commit 03847497cc30b95708124d6c643d0ea2266196ef @legastero legastero committed Oct 24, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/test_stanza_error.py
View
@@ -56,4 +56,21 @@ def testDelCondition(self):
</message>
""", 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)

0 comments on commit 0384749

Please sign in to comment.