fritzy / SleekXMPP

Python 2.6+/3.1+ XMPP Library
http://groups.google.com/group/sleekxmpp-discussion
Other
1.1k stars 299 forks source link

testUknownException fails #504

Open pgajdos opened 5 years ago

pgajdos commented 5 years ago

This is with 3.7.2. For python 2.7.16, it succeedes.

[   88s] =================================== FAILURES ===================================
[   88s] __________________ TestStreamExceptions.testUnknownException ___________________
[   88s] 
[   88s] self = <tests.test_stream_exceptions.TestStreamExceptions testMethod=testUnknownException>
[   88s] 
[   88s]     def testUnknownException(self):
[   88s]         """Test Sleek continues to respond after an unknown exception."""
[   88s]     
[   88s]         raised_errors = []
[   88s]     
[   88s]         def message(msg):
[   88s]             raise ValueError("Did something wrong")
[   88s]     
[   88s]         def catch_error(*args, **kwargs):
[   88s]             raised_errors.append(True)
[   88s]     
[   88s]         self.stream_start()
[   88s]         self.xmpp.exception = catch_error
[   88s]         self.xmpp.add_event_handler('message', message)
[   88s]     
[   88s]         self.recv("""
[   88s]           <message>
[   88s]             <body>This is going to cause an error.</body>
[   88s]           </message>
[   88s]         """)
[   88s]     
[   88s]         self.send("""
[   88s]           <message type="error">
[   88s]             <error type="cancel" code="500">
[   88s]               <undefined-condition
[   88s]                   xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
[   88s]               <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
[   88s]                 SleekXMPP got into trouble.
[   88s]               </text>
[   88s]             </error>
[   88s]           </message>
[   88s]         """)
[   88s]     
[   88s]         self.recv("""
[   88s]           <message>
[   88s]             <body>This is going to cause an error.</body>
[   88s]           </message>
[   88s]         """)
[   88s]     
[   88s]         self.send("""
[   88s]           <message type="error">
[   88s]             <error type="cancel" code="500">
[   88s]               <undefined-condition
[   88s]                   xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
[   88s]               <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
[   88s]                 SleekXMPP got into trouble.
[   88s]               </text>
[   88s]             </error>
[   88s]           </message>
[   88s]         """)
[   88s]     
[   88s] >       self.assertEqual(raised_errors, [True, True], "Exceptions were not raised: %s" % raised_errors)
[   88s] E       AssertionError: Lists differ: [True] != [True, True]
[   88s] E       
[   88s] E       Second list contains 1 additional elements.
[   88s] E       First extra element 1:
[   88s] E       True
[   88s] E       
[   88s] E       - [True]
[   88s] E       + [True, True] : Exceptions were not raised: [True]
[   88s] 
[   88s] tests/test_stream_exceptions.py:270: AssertionError
[   88s] ------------------------------ Captured log call -------------------------------
[   88s] xmlstream.py              1713 ERROR    Error processing event handler: <function TestStreamExceptions.testUnknownException.<locals>.message at 0x7fd986624730>
[   88s] Traceback (most recent call last):
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/sleekxmpp/xmlstream/xmlstream.py", line 1710, in _event_runner
[   88s]     func(*args)
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/tests/test_stream_exceptions.py", line 225, in message
[   88s]     raise ValueError("Did something wrong")
[   88s] ValueError: Did something wrong
[   88s] rootstanza.py               86 ERROR    Error handling {jabber:client}message stanza
[   88s] Traceback (most recent call last):
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/sleekxmpp/xmlstream/xmlstream.py", line 1710, in _event_runner
[   88s]     func(*args)
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/tests/test_stream_exceptions.py", line 225, in message
[   88s]     raise ValueError("Did something wrong")
[   88s] ValueError: Did something wrong
[   88s] xmlstream.py              1713 ERROR    Error processing event handler: <function TestStreamExceptions.testUnknownException.<locals>.message at 0x7fd986624730>
[   88s] Traceback (most recent call last):
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/sleekxmpp/xmlstream/xmlstream.py", line 1710, in _event_runner
[   88s]     func(*args)
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/tests/test_stream_exceptions.py", line 225, in message
[   88s]     raise ValueError("Did something wrong")
[   88s] ValueError: Did something wrong
[   88s] rootstanza.py               86 ERROR    Error handling {jabber:client}message stanza
[   88s] Traceback (most recent call last):
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/sleekxmpp/xmlstream/xmlstream.py", line 1710, in _event_runner
[   88s]     func(*args)
[   88s]   File "/home/abuild/rpmbuild/BUILD/SleekXMPP-sleek-1.3.3/tests/test_stream_exceptions.py", line 225, in message
[   88s]     raise ValueError("Did something wrong")
[   88s] ValueError: Did something wrong