Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

testUknownException fails #504

Open
pgajdos opened this issue Jun 4, 2019 · 0 comments
Open

testUknownException fails #504

pgajdos opened this issue Jun 4, 2019 · 0 comments

Comments

@pgajdos
Copy link

pgajdos commented Jun 4, 2019

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant