[telepathy-mission-control/master] dispatcher/bypass-approval.py: add a regression test for fd.o#23687
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Oct 19 16:37:15 PDT 2009
---
test/twisted/dispatcher/bypass-approval.py | 29 ++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/test/twisted/dispatcher/bypass-approval.py b/test/twisted/dispatcher/bypass-approval.py
index 4952028..02d2a2c 100644
--- a/test/twisted/dispatcher/bypass-approval.py
+++ b/test/twisted/dispatcher/bypass-approval.py
@@ -261,6 +261,35 @@ def test(q, bus, mc):
q.unforbid_events(closure)
+ # Bring back that handler
+ del bypass
+ bypass = SimulatedClient(q, bus, 'Kopete.BypassApproval',
+ observe=[], approve=[],
+ handle=[urgent_fixed_properties], bypass_approval=True)
+ expect_client_setup(q, [bypass])
+
+ # Another channel that bypasses approval comes in, but the handler that
+ # bypasses approval fails.
+
+ cdo_iface, chan, channel_properties, observe_events = announce_common(q,
+ bus, empathy, kopete, account, conn, cd_props, True)
+
+ # Both Observers indicate that they are ready to proceed
+ for e in observe_events:
+ q.dbus_return(e.message, signature='')
+
+ # Kopete's BypassApproval part is asked to handle the channels
+ e = q.expect('dbus-method-call',
+ path=bypass.object_path,
+ interface=cs.HANDLER, method='HandleChannels',
+ handled=False)
+ # Kopete's BypassApproval part fails to accept the channels
+ q.dbus_raise(e.message, 'com.example.Broken', 'No way')
+
+ # MC recovers by running the approvers and doing what they say
+ expect_and_exercise_approval(q, bus, chan, channel_properties,
+ empathy, kopete, cdo_iface, cd_props)
+
if __name__ == '__main__':
exec_test(test, {})
--
1.5.6.5
More information about the telepathy-commits
mailing list