telepathy-gabble: tube tests: stop using GetSelfHandle()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Oct 3 05:11:32 PDT 2013


Module: telepathy-gabble
Branch: master
Commit: a0e88206be4bc04f685cea57db39c5b0d9314603
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=a0e88206be4bc04f685cea57db39c5b0d9314603

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Oct  3 12:25:16 2013 +0200

tube tests: stop using GetSelfHandle()

---

 tests/twisted/tubes/accept-muc-dbus-tube.py  |    7 +++----
 tests/twisted/tubes/offer-muc-dbus-tube.py   |    6 +++---
 tests/twisted/tubes/offer-muc-stream-tube.py |    6 +++---
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tests/twisted/tubes/accept-muc-dbus-tube.py b/tests/twisted/tubes/accept-muc-dbus-tube.py
index df5b81e..3af5505 100644
--- a/tests/twisted/tubes/accept-muc-dbus-tube.py
+++ b/tests/twisted/tubes/accept-muc-dbus-tube.py
@@ -2,7 +2,7 @@ import dbus
 
 from servicetest import (
     assertEquals, assertNotEquals, assertSameSets,
-    call_async, EventPattern,
+    call_async, EventPattern, wrap_channel
 )
 from gabbletest import exec_test, acknowledge_iq, make_muc_presence
 import constants as cs
@@ -63,8 +63,7 @@ def test(q, bus, conn, stream, access_control):
                     cs.SOCKET_ACCESS_CONTROL_LOCALHOST],
         props[cs.DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS])
 
-    tube_chan = bus.get_object(conn.bus_name, path)
-    tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_IFACE_TUBE)
+    tube_chan = wrap_channel(bus.get_object(conn.bus_name, path), 'DBusTube')
     dbus_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_DBUS_TUBE)
     tube_chan_iface = dbus.Interface(tube_chan, cs.CHANNEL)
 
@@ -92,7 +91,7 @@ def test(q, bus, conn, stream, access_control):
     assertEquals('1', tube_node['id'])
     self_bus_name = tube_node['dbus-name']
 
-    tubes_self_handle = tube_chan.GetSelfHandle(dbus_interface=cs.CHANNEL_IFACE_GROUP)
+    tubes_self_handle = tube_chan.Properties.Get(cs.CHANNEL_IFACE_GROUP, 'SelfHandle')
     assertNotEquals(0, tubes_self_handle)
 
     # both of us are in DBusNames now
diff --git a/tests/twisted/tubes/offer-muc-dbus-tube.py b/tests/twisted/tubes/offer-muc-dbus-tube.py
index f778cdc..61d8879 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, assertContains, assertEquals
+from servicetest import call_async, EventPattern, assertContains, assertEquals, wrap_channel
 from gabbletest import exec_test, acknowledge_iq, elem, make_muc_presence, sync_stream
 import ns
 import constants as cs
@@ -146,7 +146,7 @@ def test(q, bus, conn, stream, access_control):
         dbus_interface=cs.PROPERTIES_IFACE, byte_arrays=True)
     assertContains((path, prop), all_channels)
 
-    tube_chan = bus.get_object(conn.bus_name, path)
+    tube_chan = wrap_channel(bus.get_object(conn.bus_name, path), 'DBusTube')
     dbus_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_DBUS_TUBE)
     chan_iface = dbus.Interface(tube_chan, cs.CHANNEL)
     tube_props = tube_chan.GetAll(cs.CHANNEL_IFACE_TUBE, dbus_interface=cs.PROPERTIES_IFACE,
@@ -171,7 +171,7 @@ def test(q, bus, conn, stream, access_control):
         EventPattern('dbus-signal', signal='TubeChannelStateChanged', args=[cs.TUBE_CHANNEL_STATE_OPEN]),
         EventPattern('dbus-signal', signal='DBusNamesChanged', interface=cs.CHANNEL_TYPE_DBUS_TUBE))
 
-    tube_self_handle = tube_chan.GetSelfHandle(dbus_interface=cs.CHANNEL_IFACE_GROUP)
+    tube_self_handle = tube_chan.Properties.Get(cs.CHANNEL_IFACE_GROUP, 'SelfHandle')
     assert tube_self_handle != 0
 
     # handle presence_event
diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index e7a7e29..02d04ea 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -5,7 +5,7 @@ import os
 
 import dbus
 
-from servicetest import call_async, EventPattern, unwrap, assertContains, assertEquals
+from servicetest import call_async, EventPattern, unwrap, assertContains, assertEquals, wrap_channel
 from gabbletest import acknowledge_iq, make_muc_presence
 import constants as cs
 import ns
@@ -120,7 +120,7 @@ def test(q, bus, conn, stream, bytestream_cls,
         dbus_interface=cs.PROPERTIES_IFACE, byte_arrays=True)
     assertContains((path, prop), all_channels)
 
-    tube_chan = bus.get_object(conn.bus_name, path)
+    tube_chan = wrap_channel(bus.get_object(conn.bus_name, path), 'StreamTube')
     stream_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_STREAM_TUBE)
     chan_iface = dbus.Interface(tube_chan, cs.CHANNEL)
     tube_props = tube_chan.GetAll(cs.CHANNEL_IFACE_TUBE, dbus_interface=cs.PROPERTIES_IFACE)
@@ -135,7 +135,7 @@ def test(q, bus, conn, stream, bytestream_cls,
         EventPattern('dbus-return', method='Offer'),
         EventPattern('dbus-signal', signal='TubeChannelStateChanged', args=[cs.TUBE_CHANNEL_STATE_OPEN]))
 
-    tube_self_handle = tube_chan.GetSelfHandle(dbus_interface=cs.CHANNEL_IFACE_GROUP)
+    tube_self_handle = tube_chan.Properties.Get(cs.CHANNEL_IFACE_GROUP, 'SelfHandle')
     assert conn.inspect_contact_sync(tube_self_handle) == 'chat at conf.localhost/test'
 
     presence = stream_event.stanza



More information about the telepathy-commits mailing list