[Telepathy-commits] [telepathy-gabble/master] test-si-tubes.py: Fix test: do not assume the new tube is the first in the ListChannels list.

Alban Crequy alban.crequy at collabora.co.uk
Mon Nov 3 11:20:58 PST 2008


---
 tests/twisted/tubes/test-si-tubes.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/twisted/tubes/test-si-tubes.py b/tests/twisted/tubes/test-si-tubes.py
index c4c80dd..7351d8c 100644
--- a/tests/twisted/tubes/test-si-tubes.py
+++ b/tests/twisted/tubes/test-si-tubes.py
@@ -208,9 +208,8 @@ def test(q, bus, conn, stream):
     assert len(new_sig.args) == 1
     assert len(new_sig.args[0]) == 1        # one channel
     assert len(new_sig.args[0][0]) == 2     # two struct members
-    assert new_sig.args[0][0][0] == ret.value[0]
+    assert new_sig.args[0][0][0] == new_chan_path
     emitted_props = new_sig.args[0][0][1]
-    print str(emitted_props)
 
     assert emitted_props[tp_name_prefix + '.Channel.ChannelType'] ==\
             tp_name_prefix + '.Channel.Type.StreamTube.DRAFT'
@@ -300,13 +299,15 @@ def test(q, bus, conn, stream):
     assert len(filter(lambda x:
                   x[1] == "org.freedesktop.Telepathy.Channel.Type.Tubes",
                   conn.ListChannels())) == 1
-    channels = filter(lambda x: x[1]
-      == "org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT",
+    channels = filter(lambda x:
+      x[1] == "org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT" and
+      x[0] == new_chan_path,
       conn.ListChannels())
-    assert len(channels) == 2
+    assert len(channels) == 1
+    assert new_chan_path == channels[0][0]
 
     tube_chan = bus.get_object(conn.bus_name, channels[0][0])
-    tube_iface = dbus.Interface(tubes_chan,
+    tube_iface = dbus.Interface(tube_chan,
         tp_name_prefix + '.Channel.Type.StreamTube.DRAFT')
 
     stream_tube_props = tube_chan.GetAll(
-- 
1.5.6.5




More information about the Telepathy-commits mailing list