[telepathy-gabble/master] add wrap_channel()

Dafydd Harries daf at rhydd.org
Fri Mar 27 10:03:19 PDT 2009


---
 tests/twisted/servicetest.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index af59501..fad67ca 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -424,6 +424,19 @@ def wrap_connection(conn):
               'Presence', 'SimplePresence', 'Requests']] +
         [('Peer', 'org.freedesktop.DBus.Peer')]))
 
+def wrap_channel(chan, type_, extra=None):
+    interfaces = {
+        type_: tp_name_prefix + '.Channel.Type.' + type_,
+        'Group': tp_name_prefix + '.Channel.Interface.Group',
+        }
+
+    if extra:
+        interfaces.update(dict([
+            (name, tp_name_prefix + '.Channel.Interface.' + name)
+            for name in extra]))
+
+    return ProxyWrapper(chan, tp_name_prefix + '.Channel', interfaces)
+
 def make_connection(bus, event_func, name, proto, params):
     cm = bus.get_object(
         tp_name_prefix + '.ConnectionManager.%s' % name,
-- 
1.5.6.5




More information about the telepathy-commits mailing list