diff options
author | Nathan Fritz <nathan@andyet.net> | 2011-08-10 13:37:49 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2011-08-10 13:37:49 -0700 |
commit | a189cb8333d5f59caa9015f0ded222696987d957 (patch) | |
tree | 467f202bc7f85a4cde85a5add3c372515f18adc3 /tests/test_stream_xep_0066.py | |
parent | 0d4825d3ea0562f305939e653e3d414e70e4aaa8 (diff) | |
parent | 156b3200e3b5ad1b2e64eecc48cdc792f7b2ffd9 (diff) | |
download | slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.gz slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.bz2 slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.tar.xz slixmpp-a189cb8333d5f59caa9015f0ded222696987d957.zip |
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'tests/test_stream_xep_0066.py')
-rw-r--r-- | tests/test_stream_xep_0066.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test_stream_xep_0066.py b/tests/test_stream_xep_0066.py new file mode 100644 index 00000000..e3f2ddfa --- /dev/null +++ b/tests/test_stream_xep_0066.py @@ -0,0 +1,44 @@ +import time +import threading + +from sleekxmpp.test import * + + +class TestOOB(SleekTest): + + def tearDown(self): + self.stream_close() + + def testSendOOB(self): + """Test sending an OOB transfer request.""" + self.stream_start(plugins=['xep_0066', 'xep_0030']) + + url = 'http://github.com/fritzy/SleekXMPP/blob/master/README' + + t = threading.Thread( + name='send_oob', + target=self.xmpp['xep_0066'].send_oob, + args=('user@example.com', url), + kwargs={'desc': 'SleekXMPP README'}) + + t.start() + + self.send(""" + <iq to="user@example.com" type="set" id="1"> + <query xmlns="jabber:iq:oob"> + <url>http://github.com/fritzy/SleekXMPP/blob/master/README</url> + <desc>SleekXMPP README</desc> + </query> + </iq> + """) + + self.recv(""" + <iq id="1" type="result" + to="tester@localhost" + from="user@example.com" /> + """) + + t.join() + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestOOB) |