[telepathy-mission-control/master] dispatcher/handle-channels-fails.py: add regression test for retrying HandleWith with the same handler
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Oct 28 14:54:25 PDT 2009
---
test/twisted/constants.py | 1 +
test/twisted/dispatcher/handle-channels-fails.py | 29 ++++++++++-----------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/twisted/constants.py b/test/twisted/constants.py
index 5aefe3b..d5e33e8 100644
--- a/test/twisted/constants.py
+++ b/test/twisted/constants.py
@@ -104,6 +104,7 @@ PERMISSION_DENIED = ERROR + '.PermissionDenied'
CANCELLED = ERROR + '.Cancelled'
NOT_YOURS = ERROR + '.NotYours'
DISCONNECTED = ERROR + '.Disconnected'
+NOT_CAPABLE = ERROR + '.NotCapable'
TUBE_PARAMETERS = CHANNEL_IFACE_TUBE + '.Parameters'
TUBE_STATE = CHANNEL_IFACE_TUBE + '.State'
diff --git a/test/twisted/dispatcher/handle-channels-fails.py b/test/twisted/dispatcher/handle-channels-fails.py
index 5c19733..adbe08e 100644
--- a/test/twisted/dispatcher/handle-channels-fails.py
+++ b/test/twisted/dispatcher/handle-channels-fails.py
@@ -167,23 +167,22 @@ def test(q, bus, mc):
sync_dbus(bus, q, mc)
q.unforbid_events(forbidden)
- if 0: # FIXME: in future this should be what happens...
- # I'm Feeling Lucky. It might work if I try again? Maybe?
- call_async(q, cdo_iface, 'HandleWith',
- cs.tp_name_prefix + '.Client.Empathy')
-
- # Empathy is asked to handle the channels, again
- e = q.expect('dbus-method-call',
- path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
- handled=False)
+ # I'm Feeling Lucky. It might work if I try again? Maybe?
+ call_async(q, cdo_iface, 'HandleWith',
+ cs.tp_name_prefix + '.Client.Empathy')
+
+ # Empathy is asked to handle the channels, again
+ e = q.expect('dbus-method-call',
+ path=empathy.object_path,
+ interface=cs.HANDLER, method='HandleChannels',
+ handled=False)
- # Empathy rejects the channels, again
- q.dbus_raise(e.message, cs.NOT_CAPABLE, 'Still drunk', bus=empathy_bus)
+ # Empathy rejects the channels, again
+ q.dbus_raise(e.message, cs.NOT_CAPABLE, 'Still drunk', bus=empathy_bus)
- e = q.expect('dbus-error', method='HandleWith')
- assert e.error.get_dbus_name() == cs.NOT_CAPABLE
- assert e.error.get_dbus_message() == 'Still drunk'
+ e = q.expect('dbus-error', method='HandleWith')
+ assert e.error.get_dbus_name() == cs.NOT_CAPABLE
+ assert e.error.get_dbus_message() == 'Still drunk'
# OK, OK, is anyone else competent enough to handle them?
# (Also, assert that MC doesn't offer them back to Empathy, knowing that
--
1.5.6.5
More information about the telepathy-commits
mailing list