Yann Leboulanger pushed to branch master at gajim / python-nbxmpp

Commits:
7fedb6c9 by Yann Leboulanger at 2017-08-11T23:23:46+02:00
[test] fix comparing xml

- - - - -


2 changed files:

- test/lib/__init__.py
- test/unit/test_xmpp_dispatcher_nb.py


Changes:

=====================================
test/lib/__init__.py
=====================================
--- a/test/lib/__init__.py
+++ b/test/lib/__init__.py
@@ -9,5 +9,12 @@ root = 
os.path.join(os.path.abspath(os.path.dirname(__file__)), '../..')
 sys.path.insert(1, root)
 sys.path.insert(1, root + '/test/lib')
 
+def sortxml(data):
+    sorted(data.attrs.keys())
+    if data.kids:
+        for a in data.kids:
+            if not isinstance(a, str):
+                sortxml(a)
+
 def setup_env():
     pass


=====================================
test/unit/test_xmpp_dispatcher_nb.py
=====================================
--- a/test/unit/test_xmpp_dispatcher_nb.py
+++ b/test/unit/test_xmpp_dispatcher_nb.py
@@ -88,6 +88,7 @@ class TestDispatcherNB(unittest.TestCase):
         self._simulate_connect()
         stanza = "<iq type='get' />"
         def send(data):
+            lib.sortxml(data)
             self.assertEqual(str(data), '<iq xmlns="jabber:client" 
type="error"><error code="501" type="cancel"><feature-not-implemented 
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text 
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">The feature requested is not 
implemented by the recipient or server and therefore cannot be 
processed.</text></error></iq>')
         self.client.send = send
         self.dispatcher.ProcessNonBlocking(stanza)



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/7fedb6c990e6d6e5dfadf4cee7d616e97396a2c4

---
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/7fedb6c990e6d6e5dfadf4cee7d616e97396a2c4
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to