summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-01 13:23:59 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-01 16:52:50 +0200
commitb1c0f935de0ada068294fa155ce87caff106cc61 (patch)
tree465e8ad13a511f067a731b2d17cf2d52fa81fe19
parent76b0a21b1198bb29cf507498de1d45c08fb7708b (diff)
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
-rw-r--r--tests/twisted/servicetest.py16
-rw-r--r--tests/twisted/sofiatest.py17
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