diff options
author | Lance Stout <lancestout@gmail.com> | 2010-11-05 14:45:58 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-11-05 21:18:48 -0400 |
commit | d0c506f93010f62cd447ce29f98ab991f521ec99 (patch) | |
tree | 80c994852cc04d4680c5db9c7e3abca77810e44e /tests/live_test.py | |
parent | 7351fe1a0226298419e3d174d7b156daad91c131 (diff) | |
download | slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.gz slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.bz2 slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.xz slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.zip |
Simplified SleekTest.
* check_stanza does not require stanza_class parameter. Introspection!
* check_message, check_iq, and check_presence removed -- use check
instead.
* stream_send_stanza, stream_send_message, stream_send_iq, and
stream_send_presence removed -- use send instead.
* Use recv instead of recv_message, recv_presence, etc.
* check_jid instead of check_JID
* stream_start may accept multi=True to return a new SleekTest instance
for testing multiple streams at once.
Diffstat (limited to 'tests/live_test.py')
-rw-r--r-- | tests/live_test.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/live_test.py b/tests/live_test.py index 7e8945f1..4b4394e9 100644 --- a/tests/live_test.py +++ b/tests/live_test.py @@ -20,9 +20,9 @@ class TestLiveStream(SleekTest): # Use sid=None to ignore any id sent by the server since # we can't know it in advance. - self.stream_recv_header(sfrom='localhost', sid=None) - self.stream_send_header(sto='localhost') - self.stream_recv_feature(""" + self.recv_header(sfrom='localhost', sid=None) + self.send_header(sto='localhost') + self.recv_feature(""" <stream:features> <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /> <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> @@ -35,15 +35,15 @@ class TestLiveStream(SleekTest): <register xmlns="http://jabber.org/features/iq-register" /> </stream:features> """) - self.stream_send_feature(""" + self.send_feature(""" <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /> """) - self.stream_recv_feature(""" + self.recv_feature(""" <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" /> """) - self.stream_send_header(sto='localhost') - self.stream_recv_header(sfrom='localhost', sid=None) - self.stream_recv_feature(""" + self.send_header(sto='localhost') + self.recv_header(sfrom='localhost', sid=None) + self.recv_feature(""" <stream:features> <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> <mechanism>DIGEST-MD5</mechanism> @@ -56,16 +56,16 @@ class TestLiveStream(SleekTest): <register xmlns="http://jabber.org/features/iq-register" /> </stream:features> """) - self.stream_send_feature(""" + self.send_feature(""" <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">AHVzZXIAdXNlcg==</auth> """) - self.stream_recv_feature(""" + self.recv_feature(""" <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" /> """) - self.stream_send_header(sto='localhost') - self.stream_recv_header(sfrom='localhost', sid=None) - self.stream_recv_feature(""" + self.send_header(sto='localhost') + self.recv_header(sfrom='localhost', sid=None) + self.recv_feature(""" <stream:features> <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" /> <session xmlns="urn:ietf:params:xml:ns:xmpp-session" /> @@ -77,16 +77,16 @@ class TestLiveStream(SleekTest): </stream:features> """) - # Should really use stream_send_iq, but our Iq stanza objects + # Should really use send, but our Iq stanza objects # can't handle bind element payloads yet. - self.stream_send_feature(""" + self.send_feature(""" <iq type="set" id="1"> <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"> <resource>test</resource> </bind> </iq> """) - self.stream_recv_feature(""" + self.recv_feature(""" <iq type="result" id="1"> <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"> <jid>user@localhost/test</jid> |