[Telepathy-commits] [telepathy-gabble/master] pass expected data len to get_data
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Mon Mar 9 10:08:45 PDT 2009
---
tests/twisted/tubes/accept-private-stream-tube.py | 7 ++++---
tests/twisted/tubes/offer-muc-stream-tube.py | 6 ++++--
tests/twisted/tubes/offer-private-stream-tube.py | 14 ++++++++------
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/tests/twisted/tubes/accept-private-stream-tube.py b/tests/twisted/tubes/accept-private-stream-tube.py
index 70c5134..d987fe0 100644
--- a/tests/twisted/tubes/accept-private-stream-tube.py
+++ b/tests/twisted/tubes/accept-private-stream-tube.py
@@ -80,7 +80,8 @@ def expect_tube_activity(q, bus, conn, stream, bytestream_cls):
query_name='si'))
protocol = event_socket.protocol
- protocol.sendData("hello initiator")
+ data = "hello initiator"
+ protocol.sendData(data)
bytestream, profile = create_from_si_offer(stream, q, bytestream_cls, event_iq.stanza,
'test at localhost/Resource')
@@ -98,8 +99,8 @@ def expect_tube_activity(q, bus, conn, stream, bytestream_cls):
bytestream.wait_bytestream_open()
- data = bytestream.get_data()
- assert data == 'hello initiator'
+ binary = bytestream.get_data(len(data))
+ assert data == binary, binary
# reply to the initiator
bytestream.send_data('hello joiner')
diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index bdedbe1..a805076 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -245,10 +245,12 @@ def test(q, bus, conn, stream, bytestream_cls):
# the server reply
event = q.expect('socket-data', data='hello initiator', protocol=protocol)
- protocol.sendData('hello joiner')
+ data = 'hello joiner'
+ protocol.sendData(data)
# we receive server's data
- binary = bytestream.get_data()
+ binary = bytestream.get_data(len(data))
+ assert binary == data, binary
# offer a stream tube to another room (new API)
srv_path = set_up_listener_socket(q, '/stream2')
diff --git a/tests/twisted/tubes/offer-private-stream-tube.py b/tests/twisted/tubes/offer-private-stream-tube.py
index 8c6571a..cebd0f2 100644
--- a/tests/twisted/tubes/offer-private-stream-tube.py
+++ b/tests/twisted/tubes/offer-private-stream-tube.py
@@ -376,19 +376,21 @@ def test(q, bus, conn, stream, bytestream_cls):
bytestream1.open_bytestream()
# have the fake client send us some data
- bytestream1.send_data('hello, world')
+ data = 'hello, world'
+ bytestream1.send_data(data)
- binary = bytestream1.get_data()
- assert binary == 'hello, world'
+ binary = bytestream1.get_data(len(data))
+ assert binary == data, binary
# have the fake client open the stream
bytestream2.open_bytestream()
# have the fake client send us some data
- bytestream2.send_data('hello, new world')
+ data = 'hello, new world'
+ bytestream2.send_data(data)
- binary = bytestream2.get_data()
- assert binary == 'hello, new world'
+ binary = bytestream2.get_data(len(data))
+ assert binary == data, binary
# OK, we're done
conn.Disconnect()
--
1.5.6.5
More information about the telepathy-commits
mailing list