diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-10-28 21:54:25 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-11-02 16:56:57 +0000 |
commit | 5b1f3c273de8d9e9c3ecfa72688ac31d168d533d (patch) | |
tree | f3f22bad502867c75f97373b8ae6c4fc081d39e0 | |
parent | e06d81ae27e9b2cdeb54c9eeb5be4071d9e03149 (diff) | |
download | telepathy-mission-control-5b1f3c273de8d9e9c3ecfa72688ac31d168d533d.tar.gz |
dispatcher/handle-channels-fails.py: add regression test for retrying HandleWith with the same handler
-rw-r--r-- | test/twisted/constants.py | 1 | ||||
-rw-r--r-- | 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 5aefe3b8..d5e33e89 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 5c19733f..adbe08ea 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 |