telepathy-gabble: servicetest: add more ifaces on wrappers

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Fri Oct 11 14:58:34 PDT 2013


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

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Oct  9 12:34:30 2013 -0400

servicetest: add more ifaces on wrappers

This will make the transition to the new interface name easier.

---

 tests/twisted/jingle/call_helper.py   |    5 ++---
 tests/twisted/muc/avatars.py          |    3 +--
 tests/twisted/muc/password.py         |    3 +--
 tests/twisted/mucutil.py              |    2 +-
 tests/twisted/servicetest.py          |   15 ++++++++++++---
 tests/twisted/text/receipts.py        |    3 +--
 tests/twisted/text/test-chat-state.py |   15 +++++----------
 tests/twisted/text/test-text.py       |    3 +--
 8 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/tests/twisted/jingle/call_helper.py b/tests/twisted/jingle/call_helper.py
index b6b1e1a..781750a 100644
--- a/tests/twisted/jingle/call_helper.py
+++ b/tests/twisted/jingle/call_helper.py
@@ -130,7 +130,7 @@ class CallTest(object):
             incoming = self.incoming
 
         content = wrap_content(self.bus.get_object(self.conn.bus_name,
-                    content_path), ['DTMF', 'Media'])
+                    content_path))
         content_props = content.GetAll(cs.CALL_CONTENT,
                 dbus_interface=dbus.PROPERTIES_IFACE)
 
@@ -316,8 +316,7 @@ class CallTest(object):
 
         chan_path = signal.args[0][0][0]
         self.chan = wrap_channel(
-                self.bus.get_object(self.conn.bus_name, chan_path),
-                'Call', ['Hold'])
+                self.bus.get_object(self.conn.bus_name, chan_path), 'Call')
 
         properties = self.chan.GetAll(cs.CHANNEL_TYPE_CALL,
             dbus_interface=dbus.PROPERTIES_IFACE)
diff --git a/tests/twisted/muc/avatars.py b/tests/twisted/muc/avatars.py
index bb3a292..323b63b 100644
--- a/tests/twisted/muc/avatars.py
+++ b/tests/twisted/muc/avatars.py
@@ -100,8 +100,7 @@ def test(q, bus, conn, stream):
           photo=AVATAR_1_SHA1))
 
     path, _ = q.expect('dbus-return', method='CreateChannel').value
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['Messages'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     members = chan.Properties.Get(cs.CHANNEL_IFACE_GROUP, 'Members')
     assertLength(3, members)
diff --git a/tests/twisted/muc/password.py b/tests/twisted/muc/password.py
index 0167bfa..ee1ec33 100644
--- a/tests/twisted/muc/password.py
+++ b/tests/twisted/muc/password.py
@@ -38,8 +38,7 @@ def test(q, bus, conn, stream):
         EventPattern('dbus-signal', signal='PasswordFlagsChanged',
             args=[cs.PASSWORD_FLAG_PROVIDE, 0]))
 
-    chan = wrap_channel(bus.get_object(conn.bus_name, cc.value[0]), 'Text',
-        ['Password'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, cc.value[0]), 'Text')
 
     flags = chan.Password.GetPasswordFlags()
     assertEquals(cs.PASSWORD_FLAG_PROVIDE, flags)
diff --git a/tests/twisted/mucutil.py b/tests/twisted/mucutil.py
index 96f3dfc..8bb830b 100644
--- a/tests/twisted/mucutil.py
+++ b/tests/twisted/mucutil.py
@@ -73,7 +73,7 @@ def join_muc(q, bus, conn, stream, muc, request=None,
             *also_capture)
     path, props = captured[0].value
     chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['Messages', 'Subject.DRAFT', 'RoomConfig1', 'ChatState'])
+        ['Subject.DRAFT'])
 
 
     return (chan, path, props) + tuple(captured[1:])
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 0beedb4..1fe8b2c 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -646,8 +646,14 @@ def wrap_connection(conn):
 def wrap_channel(chan, type_, extra=None):
     interfaces = {
         type_: tp_name_prefix + '.Channel.Type.' + type_,
-        'Channel': tp_name_prefix + '.Channel',
-        'Group': tp_name_prefix + '.Channel.Interface.Group',
+        'Channel': cs.CHANNEL,
+        'Group': cs.CHANNEL_IFACE_GROUP,
+        'Hold': cs.CHANNEL_IFACE_HOLD,
+        'Messages': cs.CHANNEL_IFACE_MESSAGES,
+        'RoomConfig1': cs.CHANNEL_IFACE_ROOM_CONFIG,
+        'ChatState': cs.CHANNEL_IFACE_CHAT_STATE,
+        'Destroyable': cs.CHANNEL_IFACE_DESTROYABLE,
+        'Password': cs.CHANNEL_IFACE_PASSWORD,
         }
 
     if extra:
@@ -659,7 +665,10 @@ def wrap_channel(chan, type_, extra=None):
 
 
 def wrap_content(chan, extra=None):
-    interfaces = { }
+    interfaces = {
+        'DTMF': cs.CALL_CONTENT_IFACE_DTMF,
+        'Media': cs.CALL_CONTENT_IFACE_MEDIA,
+        }
 
     if extra:
         interfaces.update(dict([
diff --git a/tests/twisted/text/receipts.py b/tests/twisted/text/receipts.py
index 45c7d9f..2c11af2 100644
--- a/tests/twisted/text/receipts.py
+++ b/tests/twisted/text/receipts.py
@@ -172,8 +172,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_ID: GUYBRUSH,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['Messages'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     # Let's start out with an empty roster, eh?
     e = q.expect('stream-iq', iq_type='get', query_ns=ns.ROSTER)
diff --git a/tests/twisted/text/test-chat-state.py b/tests/twisted/text/test-chat-state.py
index 6502fe3..64bd44f 100644
--- a/tests/twisted/text/test-chat-state.py
+++ b/tests/twisted/text/test-chat-state.py
@@ -48,8 +48,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_HANDLE: foo_handle,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['ChatState', 'Destroyable'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     presence = make_presence(full_jid, status='hello',
         caps={
@@ -192,8 +191,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_HANDLE: foo_handle,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['ChatState', 'Destroyable'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     # Close it immediately; the peer should again not get a <gone/>
     # notification, since we haven't sent any notifications on that channel.
@@ -216,8 +214,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_ID: jid,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['ChatState'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     stream.send(make_message(full_jid, body='i am invisible', state='active'))
 
@@ -251,8 +248,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_ID: jid,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['ChatState'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     # We shouldn't send any notifications until we actually send a message.
     # But ChatStateChanged is still emitted locally
@@ -342,8 +338,7 @@ def test(q, bus, conn, stream):
               cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
               cs.TARGET_ID: jid,
               })[0]
-    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text',
-        ['ChatState'])
+    chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
 
     # We shouldn't send any notifications until we actually send a message.
     e = EventPattern('stream-message', to=jid)
diff --git a/tests/twisted/text/test-text.py b/tests/twisted/text/test-text.py
index 380d9a6..c0b734c 100644
--- a/tests/twisted/text/test-text.py
+++ b/tests/twisted/text/test-text.py
@@ -25,8 +25,7 @@ def test(q, bus, conn, stream):
 
     event = q.expect('dbus-signal', signal='NewChannels')
     path, props = event.args[0][0]
-    text_chan = wrap_channel(
-        bus.get_object(conn.bus_name, path), 'Text', ['Messages'])
+    text_chan = wrap_channel(bus.get_object(conn.bus_name, path), 'Text')
     assertEquals(cs.CHANNEL_TYPE_TEXT, props[cs.CHANNEL_TYPE])
     assertEquals(cs.HT_CONTACT, props[cs.TARGET_HANDLE_TYPE])
     foo_at_bar_dot_com_handle = props[cs.TARGET_HANDLE]



More information about the telepathy-commits mailing list