summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-11-17 13:37:03 -0500
committerLance Stout <lancestout@gmail.com>2010-11-17 13:43:15 -0500
commitb8114b25ed28437248322aad50209f737faa392c (patch)
tree998512dd09883dd08a6facf0ae71ac0c3ba5be03 /tests
parent45991e47eeab97f0411139c5b1627ac6350de3d0 (diff)
downloadslixmpp-b8114b25ed28437248322aad50209f737faa392c.tar.gz
slixmpp-b8114b25ed28437248322aad50209f737faa392c.tar.bz2
slixmpp-b8114b25ed28437248322aad50209f737faa392c.tar.xz
slixmpp-b8114b25ed28437248322aad50209f737faa392c.zip
Make live stream tests work better.
SleekTest can now use matchers when checking stanzas, using the method parameter for self.check(), self.recv(), and self.send(): method='exact' - Same behavior as before 'xpath' - Use xpath matcher 'id' - Use ID matcher 'mask' - Use XML mask matcher 'stanzapath' - Use StanzaPath matcher recv_feature and send_feature only accept 'exact' and 'mask' for now.
Diffstat (limited to 'tests')
-rw-r--r--tests/live_test.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/tests/live_test.py b/tests/live_test.py
index 4b4394e9..16b6f1cc 100644
--- a/tests/live_test.py
+++ b/tests/live_test.py
@@ -1,3 +1,5 @@
+import logging
+
from sleekxmpp.test import *
import sleekxmpp.plugins.xep_0033 as xep_0033
@@ -29,10 +31,6 @@ class TestLiveStream(SleekTest):
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
</mechanisms>
- <c xmlns="http://jabber.org/protocol/caps"
- node="http://www.process-one.net/en/ejabberd/"
- ver="TQ2JFyRoSa70h2G1bpgjzuXb2sU=" hash="sha-1" />
- <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
""")
self.send_feature("""
@@ -49,11 +47,6 @@ class TestLiveStream(SleekTest):
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
</mechanisms>
- <c xmlns="http://jabber.org/protocol/caps"
- node="http://www.process-one.net/en/ejabberd/"
- ver="TQ2JFyRoSa70h2G1bpgjzuXb2sU="
- hash="sha-1" />
- <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
""")
self.send_feature("""
@@ -69,11 +62,6 @@ class TestLiveStream(SleekTest):
<stream:features>
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
<session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
- <c xmlns="http://jabber.org/protocol/caps"
- node="http://www.process-one.net/en/ejabberd/"
- ver="TQ2JFyRoSa70h2G1bpgjzuXb2sU="
- hash="sha-1" />
- <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
""")
@@ -99,6 +87,9 @@ class TestLiveStream(SleekTest):
suite = unittest.TestLoader().loadTestsFromTestCase(TestLiveStream)
if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG,
+ format='%(levelname)-8s %(message)s')
+
tests = unittest.TestSuite([suite])
result = unittest.TextTestRunner(verbosity=2).run(tests)
test_ns = 'http://andyet.net/protocol/tests'