tests: update 0047 tests to reflect new API

This commit is contained in:
mathieui 2021-02-13 20:01:45 +01:00
parent 3668e79fbc
commit bbcc977d1d

View file

@ -14,7 +14,7 @@ class TestInBandByteStreams(SlixTest):
def tearDown(self): def tearDown(self):
self.stream_close() self.stream_close()
def testOpenStream(self): async def testOpenStream(self):
"""Test requesting a stream, successfully""" """Test requesting a stream, successfully"""
events = [] events = []
@ -25,8 +25,8 @@ class TestInBandByteStreams(SlixTest):
self.xmpp.add_event_handler('ibb_stream_start', on_stream_start) self.xmpp.add_event_handler('ibb_stream_start', on_stream_start)
self.xmpp['xep_0047'].open_stream('tester@localhost/receiver', await self.xmpp['xep_0047'].open_stream('tester@localhost/receiver',
sid='testing') sid='testing')
self.send(""" self.send("""
<iq type="set" to="tester@localhost/receiver" id="1"> <iq type="set" to="tester@localhost/receiver" id="1">
@ -45,7 +45,7 @@ class TestInBandByteStreams(SlixTest):
self.assertEqual(events, ['ibb_stream_start']) self.assertEqual(events, ['ibb_stream_start'])
def testAysncOpenStream(self): async def testAysncOpenStream(self):
"""Test requesting a stream, aysnc""" """Test requesting a stream, aysnc"""
events = set() events = set()
@ -58,9 +58,9 @@ class TestInBandByteStreams(SlixTest):
self.xmpp.add_event_handler('ibb_stream_start', on_stream_start) self.xmpp.add_event_handler('ibb_stream_start', on_stream_start)
self.xmpp['xep_0047'].open_stream('tester@localhost/receiver', await self.xmpp['xep_0047'].open_stream('tester@localhost/receiver',
sid='testing', sid='testing',
callback=stream_callback) callback=stream_callback)
self.send(""" self.send("""
<iq type="set" to="tester@localhost/receiver" id="1"> <iq type="set" to="tester@localhost/receiver" id="1">