[telepathy-mission-control/master] mctest.SimulatedClient: add support for Handler capability tokens
Simon McVittie
simon.mcvittie at collabora.co.uk
Fri Sep 11 11:17:23 PDT 2009
---
test/twisted/mctest.py | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/test/twisted/mctest.py b/test/twisted/mctest.py
index 27afd11..36e05c0 100644
--- a/test/twisted/mctest.py
+++ b/test/twisted/mctest.py
@@ -564,7 +564,8 @@ def aasv(x):
class SimulatedClient(object):
def __init__(self, q, bus, clientname,
- observe=[], approve=[], handle=[], bypass_approval=False,
+ observe=[], approve=[], handle=[],
+ cap_tokens=[], bypass_approval=False,
request_notification=True, implement_get_interfaces=True):
self.q = q
self.bus = bus
@@ -577,6 +578,7 @@ class SimulatedClient(object):
self.bypass_approval = bool(bypass_approval)
self.request_notification = bool(request_notification)
self.handled_channels = dbus.Array([], signature='o')
+ self.cap_tokens = dbus.Array(cap_tokens, signature='s')
if implement_get_interfaces:
q.add_dbus_method_impl(self.Get_Interfaces,
@@ -606,6 +608,9 @@ class SimulatedClient(object):
q.add_dbus_method_impl(self.Get_HandlerChannelFilter,
path=self.object_path, interface=cs.PROPERTIES_IFACE,
method='Get', args=[cs.HANDLER, 'HandlerChannelFilter'])
+ q.add_dbus_method_impl(self.Get_Capabilities,
+ path=self.object_path, interface=cs.PROPERTIES_IFACE,
+ method='Get', args=[cs.HANDLER, 'Capabilities'])
q.add_dbus_method_impl(self.Get_HandledChannels,
path=self.object_path, interface=cs.PROPERTIES_IFACE,
method='Get', args=[cs.HANDLER, 'HandledChannels'])
@@ -671,9 +676,14 @@ class SimulatedClient(object):
'HandlerChannelFilter': self.handle,
'BypassApproval': self.bypass_approval,
'HandledChannels': self.handled_channels,
+ 'Capabilities': self.cap_tokens,
},
signature='a{sv}', bus=self.bus)
+ def Get_Capabilities(self, e):
+ self.q.dbus_return(e.message, self.cap_tokens, signature='v',
+ bus=self.bus)
+
def Get_HandledChannels(self, e):
self.q.dbus_return(e.message, self.handled_channels, signature='v',
bus=self.bus)
--
1.5.6.5
More information about the telepathy-commits
mailing list