[next] telepathy-mission-control: SimulatedChannel: fill in extra immutable properties
Simon McVittie
smcv at kemper.freedesktop.org
Fri Oct 4 06:00:41 PDT 2013
Module: telepathy-mission-control
Branch: next
Commit: 9d27f8cc2127823c0084d8c221a5e6874a638b2c
URL: http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=9d27f8cc2127823c0084d8c221a5e6874a638b2c
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Thu Oct 3 16:00:52 2013 +0100
SimulatedChannel: fill in extra immutable properties
Not all of our regression tests fill in all the necessary immutable
properties for a modern TpChannel to prepare; some of them cut corners.
Fill in the gaps.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54879
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
tests/twisted/mctest.py | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/tests/twisted/mctest.py b/tests/twisted/mctest.py
index 3704eef..7e0350b 100644
--- a/tests/twisted/mctest.py
+++ b/tests/twisted/mctest.py
@@ -608,9 +608,24 @@ class SimulatedChannel(object):
self.q = conn.q
self.bus = conn.bus
self.object_path = conn.object_path + ('/_%x' % id(self))
- self.immutable = immutable
+ self.immutable = immutable.copy()
+
+ if self.immutable[cs.TARGET_HANDLE_TYPE] != cs.HT_NONE:
+ if (cs.TARGET_ID in self.immutable) != (
+ cs.TARGET_HANDLE in self.immutable):
+ if cs.TARGET_ID in self.immutable:
+ self.immutable[cs.TARGET_HANDLE] = conn.ensure_handle(
+ self.immutable[cs.TARGET_HANDLE_TYPE],
+ self.immutable[cs.TARGET_ID])
+ else:
+ self.immutable[cs.TARGET_ID] = conn.inspect_handles(
+ [self.immutable[cs.TARGET_HANDLE]])[0]
+
+ if cs.REQUESTED not in self.immutable:
+ self.immutable[cs.REQUESTED] = False
+
self.properties = dbus.Dictionary({}, signature='sv')
- self.properties.update(immutable)
+ self.properties.update(self.immutable)
self.properties.update(mutable)
self.q.add_dbus_method_impl(self.GetAll,
More information about the telepathy-commits
mailing list