telepathy-rakia: tests: move D-Bus signal handler to sofiatest

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Tue Oct 1 08:41:30 PDT 2013


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

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Oct  1 13:23:59 2013 +0200

tests: move D-Bus signal handler to sofiatest

Gabble moved the equivalent test handler out of servicetest a while ago.

https://bugs.freedesktop.org/show_bug.cgi?id=69995

---

 tests/twisted/servicetest.py |   16 ----------------
 tests/twisted/sofiatest.py   |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 5685eec..b871e1b 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -457,22 +457,6 @@ def make_connection(bus, event_func, name, proto, params):
         proto, params)
     conn = wrap_connection(bus.get_object(connection_name, connection_path))
 
-    bus.add_signal_receiver(
-        lambda *args, **kw:
-            event_func(
-                Event('dbus-signal',
-                    path=unwrap(kw['path']),
-                    signal=kw['member'], args=map(unwrap, args),
-                    interface=kw['interface'])),
-        None,       # signal name
-        None,       # interface
-        cm._named_service,
-        path_keyword='path',
-        member_keyword='member',
-        interface_keyword='interface',
-        byte_arrays=True
-        )
-
     return conn
 
 def make_channel_proxy(conn, path, iface):
diff --git a/tests/twisted/sofiatest.py b/tests/twisted/sofiatest.py
index ad85947..3abfa3b 100644
--- a/tests/twisted/sofiatest.py
+++ b/tests/twisted/sofiatest.py
@@ -3,6 +3,7 @@ Telepathy-Rakia testing framework
 """
 
 import servicetest
+from servicetest import (unwrap, Event)
 
 from twisted.protocols import sip
 from twisted.internet import reactor
@@ -73,6 +74,22 @@ def prepare_test(event_func, register_cb, params=None):
     conn = servicetest.make_connection(bus, event_func,
         'sofiasip', 'sip', actual_params)
 
+    bus.add_signal_receiver(
+        lambda *args, **kw:
+            event_func(
+                Event('dbus-signal',
+                    path=unwrap(kw['path']),
+                    signal=kw['member'], args=map(unwrap, args),
+                    interface=kw['interface'])),
+        None,       # signal name
+        None,       # interface
+        None,
+        path_keyword='path',
+        member_keyword='member',
+        interface_keyword='interface',
+        byte_arrays=True
+        )
+
     port = int(actual_params['port'])
     sip = SipProxy(host=actual_params['proxy-host'], port=port)
     sip.event_func = event_func



More information about the telepathy-commits mailing list