2011-07-03 07:35:36 +00:00
|
|
|
import threading
|
|
|
|
|
2013-07-26 11:02:26 +00:00
|
|
|
import unittest
|
2014-07-17 12:19:04 +00:00
|
|
|
from slixmpp.test import SlixTest
|
2011-07-03 07:35:36 +00:00
|
|
|
|
|
|
|
|
2014-07-17 12:19:04 +00:00
|
|
|
class TestOOB(SlixTest):
|
2011-07-03 07:35:36 +00:00
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
self.stream_close()
|
|
|
|
|
|
|
|
def testSendOOB(self):
|
|
|
|
"""Test sending an OOB transfer request."""
|
|
|
|
self.stream_start(plugins=['xep_0066', 'xep_0030'])
|
|
|
|
|
2014-07-17 12:19:04 +00:00
|
|
|
url = 'http://github.com/fritzy/Slixmpp/blob/master/README'
|
2011-07-03 07:35:36 +00:00
|
|
|
|
2015-02-12 11:23:47 +00:00
|
|
|
self.xmpp['xep_0066'].send_oob('user@example.com', url,
|
|
|
|
desc='Slixmpp README')
|
2011-07-03 07:35:36 +00:00
|
|
|
|
|
|
|
self.send("""
|
|
|
|
<iq to="user@example.com" type="set" id="1">
|
|
|
|
<query xmlns="jabber:iq:oob">
|
2014-07-17 12:19:04 +00:00
|
|
|
<url>http://github.com/fritzy/Slixmpp/blob/master/README</url>
|
|
|
|
<desc>Slixmpp README</desc>
|
2011-07-03 07:35:36 +00:00
|
|
|
</query>
|
|
|
|
</iq>
|
|
|
|
""")
|
|
|
|
|
|
|
|
self.recv("""
|
|
|
|
<iq id="1" type="result"
|
|
|
|
to="tester@localhost"
|
|
|
|
from="user@example.com" />
|
|
|
|
""")
|
|
|
|
|
|
|
|
|
|
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestOOB)
|