[Telepathy-commits] [telepathy-gabble/master] Break offer-private-dbus-tube-ibb into two functions

Will Thompson will.thompson at collabora.co.uk
Tue Feb 3 03:36:37 PST 2009


---
 tests/twisted/tubes/offer-private-dbus-tube-ibb.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
index 10ccab4..7f85dd7 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
@@ -71,7 +71,11 @@ def test(q, bus, conn, stream):
 
     sync_stream(q, stream)
 
-    # request tubes channe (old API)
+    offer_old_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
+    offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
+
+def offer_old_dbus_tube(q, bus, conn, stream, self_handle, alice_handle):
+    # request tubes channel (old API)
     tubes_path = conn.RequestChannel('org.freedesktop.Telepathy.Channel.Type.Tubes',
         HT_CONTACT, alice_handle, True)
     tubes_chan = bus.get_object(conn.bus_name, tubes_path)
@@ -213,7 +217,8 @@ def test(q, bus, conn, stream):
     tubes_chan_iface.Close()
     q.expect('dbus-signal', signal='Closed')
 
-    # Let's try the new tube API
+
+def offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle):
     requestotron = dbus.Interface(conn,
         'org.freedesktop.Telepathy.Connection.Interface.Requests')
 
@@ -285,7 +290,7 @@ def test(q, bus, conn, stream):
     for path, details in new_channel_details:
         if details[CHANNEL_TYPE] == CHANNEL_TYPE_TUBES:
             found_tubes = True
-            tubes_chan = bus.get_object(conn.bus_name, tubes_path)
+            tubes_chan = bus.get_object(conn.bus_name, path)
             tubes_iface = dbus.Interface(tubes_chan, CHANNEL_TYPE_TUBES)
         elif details[CHANNEL_TYPE] == CHANNEL_TYPE_DBUS_TUBE:
             found_tube = True
-- 
1.5.6.5




More information about the telepathy-commits mailing list