From 7d0a154d7f0d1197b9f6a97e593f17524a24f777 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 1 Oct 2013 13:23:59 +0200 Subject: [PATCH 3/6] 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 -- 1.8.3.1