[telepathy-gabble/master] use assertContains

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


---
 tests/twisted/tubes/offer-muc-dbus-tube.py     |    4 ++--
 tests/twisted/tubes/offer-muc-stream-tube.py   |    5 +++--
 tests/twisted/tubes/offer-private-dbus-tube.py |    5 +++--
 tests/twisted/tubes/tubetestutil.py            |    4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/tests/twisted/tubes/offer-muc-dbus-tube.py b/tests/twisted/tubes/offer-muc-dbus-tube.py
index 90918a8..7d24e25 100644
--- a/tests/twisted/tubes/offer-muc-dbus-tube.py
+++ b/tests/twisted/tubes/offer-muc-dbus-tube.py
@@ -6,7 +6,7 @@ import dbus
 from dbus.connection import Connection
 from dbus.lowlevel import SignalMessage
 
-from servicetest import call_async, EventPattern
+from servicetest import call_async, EventPattern, assertContains
 from gabbletest import exec_test, acknowledge_iq, elem
 import ns
 import constants as cs
@@ -234,7 +234,7 @@ def test(q, bus, conn, stream):
     # check that the tube 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, prop) in all_channels
+    assertContains((path, prop), all_channels)
 
     tube_chan = bus.get_object(conn.bus_name, path)
     dbus_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_DBUS_TUBE)
diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index ec4b0ae..5e648ae 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -5,7 +5,8 @@ import os
 
 import dbus
 
-from servicetest import call_async, EventPattern, EventProtocolFactory, unwrap
+from servicetest import call_async, EventPattern, EventProtocolFactory, unwrap,\
+    assertContains
 from gabbletest import acknowledge_iq, make_muc_presence
 import constants as cs
 import ns
@@ -254,7 +255,7 @@ def test(q, bus, conn, stream, bytestream_cls):
     # check that the tube 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, prop) in all_channels
+    assertContains((path, prop), all_channels)
 
     tube_chan = bus.get_object(conn.bus_name, path)
     stream_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_STREAM_TUBE)
diff --git a/tests/twisted/tubes/offer-private-dbus-tube.py b/tests/twisted/tubes/offer-private-dbus-tube.py
index fa8a5f4..3d8d4d6 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube.py
@@ -4,7 +4,8 @@ import dbus
 from dbus.connection import Connection
 from dbus.lowlevel import SignalMessage
 
-from servicetest import call_async, EventPattern, unwrap, watch_tube_signals
+from servicetest import call_async, EventPattern, unwrap, watch_tube_signals,\
+    assertContains
 from gabbletest import sync_stream, make_presence
 import constants as cs
 import tubetestutil as t
@@ -197,7 +198,7 @@ def offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle, bytestr
         dbus_interface=cs.PROPERTIES_IFACE, byte_arrays=True)
 
     for path, props in new_channel_details:
-        assert (path, props) in all_channels, (path, props)
+        assertContains((path, props), all_channels)
 
     # Under the current implementation, creating a new-style Tube channel
     # ensures that an old-style Tubes channel exists, even though Tube channels
diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index c11e88b..3494aef 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -7,7 +7,7 @@ import os
 
 import dbus
 
-from servicetest import unwrap
+from servicetest import unwrap, assertContains
 from gabbletest import exec_test
 import constants as cs
 import bytestream
@@ -150,7 +150,7 @@ def check_NewChannels_signal(conn, args, channel_type, chan_path, contact_handle
     # 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
+    assertContains((path, props), 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