[telepathy-gabble/master] check_NewChannels_signal: check if the channel is in Requests's Channels property

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 15 09:34:14 PDT 2009


---
 tests/twisted/tubes/offer-private-stream-tube.py |    6 +++---
 tests/twisted/tubes/tubetestutil.py              |    7 ++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/tubes/offer-private-stream-tube.py b/tests/twisted/tubes/offer-private-stream-tube.py
index 7eba695..9cbecf7 100644
--- a/tests/twisted/tubes/offer-private-stream-tube.py
+++ b/tests/twisted/tubes/offer-private-stream-tube.py
@@ -115,7 +115,7 @@ def test(q, bus, conn, stream, bytestream_cls):
 
     t.check_NewChannel_signal(old_sig.args, cs.CHANNEL_TYPE_TUBES, chan_path,
             bob_handle, True)
-    t.check_NewChannels_signal(new_sig.args, cs.CHANNEL_TYPE_TUBES, chan_path,
+    t.check_NewChannels_signal(conn, new_sig.args, cs.CHANNEL_TYPE_TUBES, chan_path,
             bob_handle, 'bob at localhost', self_handle)
     old_tubes_channel_properties = new_sig.args[0][0]
 
@@ -162,7 +162,7 @@ def test(q, bus, conn, stream, bytestream_cls):
 
     t.check_NewChannel_signal(old_sig.args, cs.CHANNEL_TYPE_STREAM_TUBE,
             new_chan_path, bob_handle, True)
-    t.check_NewChannels_signal(new_sig.args, cs.CHANNEL_TYPE_STREAM_TUBE,
+    t.check_NewChannels_signal(conn, new_sig.args, cs.CHANNEL_TYPE_STREAM_TUBE,
             new_chan_path, bob_handle, 'bob at localhost', self_handle)
     stream_tube_channel_properties = new_sig.args[0][0]
     assert cs.TUBE_STATE not in stream_tube_channel_properties
@@ -215,7 +215,7 @@ def test(q, bus, conn, stream, bytestream_cls):
     # the tube channel (new API) is announced
     t.check_NewChannel_signal(new_chan.args, cs.CHANNEL_TYPE_STREAM_TUBE,
         None, bob_handle, False)
-    t.check_NewChannels_signal(new_chans.args, cs.CHANNEL_TYPE_STREAM_TUBE,
+    t.check_NewChannels_signal(conn, new_chans.args, cs.CHANNEL_TYPE_STREAM_TUBE,
         new_chan.args[0], bob_handle, "bob at localhost", self_handle)
 
     props = new_chans.args[0][0][1]
diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index 570ff8a..c11e88b 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -126,7 +126,7 @@ def check_NewChannel_signal(args, channel_type, chan_path, contact_handle,
     assert args[3] == contact_handle, (args, contact_handle)
     assert args[4] == suppress_handler, (args, suppress_handler)
 
-def check_NewChannels_signal(args, channel_type, chan_path, contact_handle,
+def check_NewChannels_signal(conn, args, channel_type, chan_path, contact_handle,
                              contact_id, initiator_handle):
     """
     Checks the first argument, a one-tuple of arguments from NewChannels,
@@ -147,6 +147,11 @@ def check_NewChannels_signal(args, channel_type, chan_path, contact_handle,
         (props, initiator_handle)
     assert props[cs.INITIATOR_ID] == 'test at localhost', props
 
+    # check that the newly announced channel is in the channels list
+    all_channels = conn.Get(cs.CONN_IFACE_REQUESTS, 'Channels',
+        dbus_interface=cs.PROPERTIES_IFACE, byte_arrays=True)
+    assert (path, props) in all_channels
+
 def check_channel_properties(q, bus, conn, channel, channel_type,
                              contact_handle, contact_id, state=None):
     """
-- 
1.5.6.5




More information about the telepathy-commits mailing list