diff options
Diffstat (limited to 'tests')
33 files changed, 248 insertions, 303 deletions
diff --git a/tests/twisted/account-requests/create-text.py b/tests/twisted/account-requests/create-text.py index 3ef1a486..a79299d2 100644 --- a/tests/twisted/account-requests/create-text.py +++ b/tests/twisted/account-requests/create-text.py @@ -134,16 +134,14 @@ def test_channel_creation(q, bus, account, client, conn, ensure): # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, e.args.object_path + assert e.args[3] == channel_immutable, e.args + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args # Observer says "OK, go" q.dbus_return(e.message, signature='') diff --git a/tests/twisted/crash-recovery/crash-recovery.py b/tests/twisted/crash-recovery/crash-recovery.py index a6963e59..432082a0 100644 --- a/tests/twisted/crash-recovery/crash-recovery.py +++ b/tests/twisted/crash-recovery/crash-recovery.py @@ -106,13 +106,13 @@ def test(q, bus, unused, **kwargs): e, = mc.wait_for_names( EventPattern('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[1] == conn.object_path, e.args - channels = e.args[2] - assert channels[0][0] == unhandled_chan.object_path, channels + chan_path = e.args[2] + assert chan_path == unhandled_chan.object_path, e.args q.dbus_return(e.message, signature='') # ... and as a handler diff --git a/tests/twisted/dispatcher/already-has-channel.py b/tests/twisted/dispatcher/already-has-channel.py index 8e64b988..211da3d2 100644 --- a/tests/twisted/dispatcher/already-has-channel.py +++ b/tests/twisted/dispatcher/already-has-channel.py @@ -139,21 +139,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, chan.object_path + assert e.args[3] == channel_properties, channel_properties + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args diff --git a/tests/twisted/dispatcher/approver-fails.py b/tests/twisted/dispatcher/approver-fails.py index ef49f560..a09ddf91 100644 --- a/tests/twisted/dispatcher/approver-fails.py +++ b/tests/twisted/dispatcher/approver-fails.py @@ -108,16 +108,15 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, chan.object_path + assert e.args[3] == channel_properties, channel_properties + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied + q.dbus_return(e.message, bus=empathy_bus, signature='') diff --git a/tests/twisted/dispatcher/bypass-approval.py b/tests/twisted/dispatcher/bypass-approval.py index 0bef1f64..97a9c6ab 100644 --- a/tests/twisted/dispatcher/bypass-approval.py +++ b/tests/twisted/dispatcher/bypass-approval.py @@ -109,21 +109,19 @@ def announce_common(q, bus, empathy, kopete, account, conn, cd_props, e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, chan.object_path + assert e.args[3] == channel_properties, channel_properties + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args diff --git a/tests/twisted/dispatcher/capture-bundle.py b/tests/twisted/dispatcher/capture-bundle.py index 5da029ef..dc4b034a 100644 --- a/tests/twisted/dispatcher/capture-bundle.py +++ b/tests/twisted/dispatcher/capture-bundle.py @@ -118,21 +118,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, chan.object_path + assert e.args[3] == channel_properties, channel_properties + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args @@ -248,21 +246,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, chan.object_path + assert e.args[3] == channel_properties, channel_properties + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args diff --git a/tests/twisted/dispatcher/cdo-claim.py b/tests/twisted/dispatcher/cdo-claim.py index 01d94101..9d109b0b 100644 --- a/tests/twisted/dispatcher/cdo-claim.py +++ b/tests/twisted/dispatcher/cdo-claim.py @@ -74,7 +74,7 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=logger.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=gs.object_path, @@ -117,7 +117,7 @@ def test(q, bus, mc): # Logger recovers the channel e = q.expect('dbus-method-call', path=logger.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) # gnome-shell which is handling the channel asks to re-ensure it diff --git a/tests/twisted/dispatcher/create-at-startup.py b/tests/twisted/dispatcher/create-at-startup.py index 72c2198c..b74d6ddc 100644 --- a/tests/twisted/dispatcher/create-at-startup.py +++ b/tests/twisted/dispatcher/create-at-startup.py @@ -168,21 +168,18 @@ def test(q, bus, unused, **kwargs): path=conn.object_path, handled=True), EventPattern('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False), ) - assert a.args[0] == account.object_path, a.args assert a.args[1] == conn.object_path, a.args - assert a.args[3] != '/', a.args # there is a dispatch operation - assert a.args[4] == [], a.args - channels = a.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == announcement.object_path, channels - assert channels[0][1] == announcement_immutable, channels + assert a.args[2] == announcement.object_path, channels + assert a.args[3] == announcement_immutable, channels + assert a.args[4] != '/', a.args # there is a dispatch operation + assert a.args[5] == [], e.args # no requests satisfied # Time passes. A channel is returned. @@ -203,17 +200,14 @@ def test(q, bus, unused, **kwargs): # Empathy observes the newly-created channel. e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation # Observer says "OK, go" q.dbus_return(a.message, signature='') diff --git a/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py b/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py index 1c91eb88..1d675546 100644 --- a/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py +++ b/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py @@ -105,7 +105,7 @@ def test(q, bus, mc): forbidden = [ EventPattern('dbus-method-call', method='CreateChannel'), EventPattern('dbus-method-call', method='EnsureChannel'), - EventPattern('dbus-method-call', method='ObserveChannels'), + EventPattern('dbus-method-call', method='ObserveChannel'), EventPattern('dbus-method-call', method='AddDispatchOperation'), EventPattern('dbus-method-call', method='HandleChannel'), ] diff --git a/tests/twisted/dispatcher/create-handler-fails.py b/tests/twisted/dispatcher/create-handler-fails.py index cc1eeea2..ac8e00ea 100644 --- a/tests/twisted/dispatcher/create-handler-fails.py +++ b/tests/twisted/dispatcher/create-handler-fails.py @@ -139,16 +139,14 @@ def test_channel_creation(q, bus, account, client, conn, ensure): # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args # Observer says "OK, go" q.dbus_return(e.message, signature='') diff --git a/tests/twisted/dispatcher/create-hints.py b/tests/twisted/dispatcher/create-hints.py index 2e6fb557..6c2b9f42 100644 --- a/tests/twisted/dispatcher/create-hints.py +++ b/tests/twisted/dispatcher/create-hints.py @@ -141,17 +141,15 @@ def test_channel_creation(q, bus, account, client, conn, # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels - info = e.args[5] + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args # no requests satisfied + info = e.args[6] assert info['request-properties'] == {request_path: request_props}, info # Observer says "OK, go" diff --git a/tests/twisted/dispatcher/create-no-preferred-handler.py b/tests/twisted/dispatcher/create-no-preferred-handler.py index e433a555..954d95f7 100644 --- a/tests/twisted/dispatcher/create-no-preferred-handler.py +++ b/tests/twisted/dispatcher/create-no-preferred-handler.py @@ -145,16 +145,14 @@ def test_channel_creation(q, bus, account, client, conn, ensure): # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args # Observer says "OK, go" q.dbus_return(e.message, signature='') diff --git a/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py b/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py index fb09df45..427f21fc 100644 --- a/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py +++ b/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py @@ -39,7 +39,7 @@ def test(q, bus, mc): forbidden = [ EventPattern('dbus-method-call', method='CreateChannel'), EventPattern('dbus-method-call', method='EnsureChannel'), - EventPattern('dbus-method-call', method='ObserveChannels'), + EventPattern('dbus-method-call', method='ObserveChannel'), EventPattern('dbus-method-call', method='AddDispatchOperation'), EventPattern('dbus-method-call', method='HandleChannel'), ] diff --git a/tests/twisted/dispatcher/create-text.py b/tests/twisted/dispatcher/create-text.py index 43001968..56923e6e 100644 --- a/tests/twisted/dispatcher/create-text.py +++ b/tests/twisted/dispatcher/create-text.py @@ -160,16 +160,15 @@ def test_channel_creation(q, bus, account, client, conn, # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args + # Observer says "OK, go" q.dbus_return(e.message, signature='') diff --git a/tests/twisted/dispatcher/created-behind-our-back.py b/tests/twisted/dispatcher/created-behind-our-back.py index b1e03517..d768c099 100644 --- a/tests/twisted/dispatcher/created-behind-our-back.py +++ b/tests/twisted/dispatcher/created-behind-our-back.py @@ -78,21 +78,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, channel.object_path + assert e.args[3] == channel_immutable, channel_immutable + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [], e.args # no requests satisfied assert e.args == k.args diff --git a/tests/twisted/dispatcher/delay-approvers.py b/tests/twisted/dispatcher/delay-approvers.py index cf278d85..be11acc7 100644 --- a/tests/twisted/dispatcher/delay-approvers.py +++ b/tests/twisted/dispatcher/delay-approvers.py @@ -85,7 +85,7 @@ def test(q, bus, mc): # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from - # ObserveChannels. + # ObserveChannel. forbidden = [EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation')] @@ -93,7 +93,7 @@ def test(q, bus, mc): o = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) # Waste a little time here and there. We can't call sync_dbus @@ -102,7 +102,7 @@ def test(q, bus, mc): call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') - # Finally return from ObserveChannels, so now we expect ADO to be + # Finally return from ObserveChannel, so now we expect ADO to be # called on Kopete. q.dbus_return(o.message, bus=bus, signature='') q.unforbid_events(forbidden) diff --git a/tests/twisted/dispatcher/delay-then-call-handle-with.py b/tests/twisted/dispatcher/delay-then-call-handle-with.py index 62fc6989..f0a05afb 100644 --- a/tests/twisted/dispatcher/delay-then-call-handle-with.py +++ b/tests/twisted/dispatcher/delay-then-call-handle-with.py @@ -85,7 +85,7 @@ def test(q, bus, mc): # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from - # ObserveChannels, but Empathy will call HandleWith(Kopete) on the + # ObserveChannel, but Empathy will call HandleWith(Kopete) on the # CDO so we should ensure ADO is never called on any approver. forbidden = [EventPattern('dbus-method-call', interface=cs.APPROVER, method='AddDispatchOperation')] @@ -93,7 +93,7 @@ def test(q, bus, mc): o = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) # Waste a little time here and there. We can't call sync_dbus @@ -106,7 +106,7 @@ def test(q, bus, mc): # HandleChannel returns. call_async(q, cdo_iface, 'HandleWith', cs.CLIENT + '.Kopete', 0) - # Finally return from ObserveChannels. + # Finally return from ObserveChannel. q.dbus_return(o.message, bus=bus, signature='') h = q.expect('dbus-method-call', diff --git a/tests/twisted/dispatcher/delay-then-dont-call-approvers.py b/tests/twisted/dispatcher/delay-then-dont-call-approvers.py index 27c26363..b30377e3 100644 --- a/tests/twisted/dispatcher/delay-then-dont-call-approvers.py +++ b/tests/twisted/dispatcher/delay-then-dont-call-approvers.py @@ -85,7 +85,7 @@ def test(q, bus, mc): # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from - # ObserveChannels, but Empathy will call Claim on the CDO so we + # ObserveChannel, but Empathy will call Claim on the CDO so we # should ensure neither ADO or HC is called on any of our clients. forbidden = [EventPattern('dbus-method-call', interface=cs.APPROVER, method='AddDispatchOperation'), @@ -95,7 +95,7 @@ def test(q, bus, mc): o = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) # Waste a little time here and there. We can't call sync_dbus @@ -105,10 +105,10 @@ def test(q, bus, mc): event = q.expect('dbus-return', method='Get') # We can't call this synchronously because MC won't return until - # ObserveChannels calls return. + # ObserveChannel calls return. call_async(q, cdo_iface, 'Claim') - # Finally return from ObserveChannels. + # Finally return from ObserveChannel. q.dbus_return(o.message, bus=bus, signature='') q.expect('dbus-return', method='Claim') diff --git a/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py b/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py index 33f4f1a1..c4d4d687 100644 --- a/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py +++ b/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py @@ -74,11 +74,11 @@ def signal_channel_expect_query(q, bus, account, conn, empathy, kopete): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) diff --git a/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py b/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py index 0eb11d01..3f79f1c4 100644 --- a/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py +++ b/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py @@ -107,7 +107,7 @@ def test(q, bus, mc): cs.tp_name_prefix + '.Client.Kopete'], handlers # The plugin realises we've been rickrolled, and responds. It calls Destroy - # even though neither Empathy nor Kopete has returned from ObserveChannels + # even though neither Empathy nor Kopete has returned from ObserveChannel # yet destruction, e, k = q.expect_many( EventPattern('dbus-method-call', @@ -116,11 +116,11 @@ def test(q, bus, mc): args=[], handled=False), EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) # treat the destruction like Close @@ -182,11 +182,11 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) diff --git a/tests/twisted/dispatcher/dispatch-text.py b/tests/twisted/dispatcher/dispatch-text.py index 2d9438d2..c0261410 100644 --- a/tests/twisted/dispatcher/dispatch-text.py +++ b/tests/twisted/dispatcher/dispatch-text.py @@ -120,21 +120,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args @@ -251,21 +249,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args @@ -374,21 +370,19 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == claimed_chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == claimed_chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args @@ -471,11 +465,11 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) q.dbus_return(k.message, bus=kopete_bus, signature='') diff --git a/tests/twisted/dispatcher/ensure-and-redispatch.py b/tests/twisted/dispatcher/ensure-and-redispatch.py index ddda1ada..38a05edb 100644 --- a/tests/twisted/dispatcher/ensure-and-redispatch.py +++ b/tests/twisted/dispatcher/ensure-and-redispatch.py @@ -163,16 +163,14 @@ def test_channel_creation(q, bus, account, client, conn): # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert e.args[4] == [request_path], e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel_immutable, channels + assert e.args[2] == channel.object_path, e.args + assert e.args[3] == channel_immutable, e.args + assert e.args[4] == '/', e.args # no dispatch operation + assert e.args[5] == [request_path], e.args # Observer says "OK, go" q.dbus_return(e.message, signature='') @@ -207,7 +205,7 @@ def test_channel_redispatch(q, bus, account, client, conn, channel, forbidden = [ # Because we create no new channels, nothing should be observed. - EventPattern('dbus-method-call', method='ObserveChannels'), + EventPattern('dbus-method-call', method='ObserveChannel'), # Even though there is a better handler on a different unique # name, the channels must not be re-dispatched to it. EventPattern('dbus-method-call', method='HandleChannel', diff --git a/tests/twisted/dispatcher/ensure-is-approval.py b/tests/twisted/dispatcher/ensure-is-approval.py index 2ceea63a..d4945ff1 100644 --- a/tests/twisted/dispatcher/ensure-is-approval.py +++ b/tests/twisted/dispatcher/ensure-is-approval.py @@ -128,21 +128,20 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied + assert k.args == e.args diff --git a/tests/twisted/dispatcher/ensure-rapidly.py b/tests/twisted/dispatcher/ensure-rapidly.py index 46b5eb11..f2909ff3 100644 --- a/tests/twisted/dispatcher/ensure-rapidly.py +++ b/tests/twisted/dispatcher/ensure-rapidly.py @@ -167,7 +167,7 @@ def test_channel_creation(q, bus, account, client, conn, conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) - # Having announce() (i.e. NewChannels) come last is guaranteed by + # Having announce() (i.e. NewChannel) come last is guaranteed by # telepathy-spec (since 0.17.14). There is no other ordering guarantee. if swap_requests: @@ -185,17 +185,15 @@ def test_channel_creation(q, bus, account, client, conn, # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == '/', e.args # no dispatch operation - assert sorted(e.args[4]) == sorted([cr1.object_path, - cr2.object_path]), e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == channel.object_path, channels - assert channels[0][1] == channel.immutable, channels + assert e.args[2] == channel.object_path, e.args + assert e.args[3] == channel.immutable, e.args + assert e.args[4] == '/', e.args # no dispatch operation + assert sorted(e.args[5]) == sorted([cr1.object_path, + cr2.object_path]), e.args[5] # Observer says "OK, go" q.dbus_return(e.message, signature='') diff --git a/tests/twisted/dispatcher/exploding-bundles.py b/tests/twisted/dispatcher/exploding-bundles.py index 9eaa6cf4..9fb7e240 100644 --- a/tests/twisted/dispatcher/exploding-bundles.py +++ b/tests/twisted/dispatcher/exploding-bundles.py @@ -105,7 +105,8 @@ def test(q, bus, mc): media_chan = SimulatedChannel(conn, media_channel_properties, destroyable=False) - conn.NewChannels([text_chan, media_chan]) + conn.NewChannel(text_chan) + conn.NewChannel(media_chan) # A channel dispatch operation is created for the Text channel first. @@ -135,25 +136,40 @@ def test(q, bus, mc): e_observe_text, k_observe_text = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e_observe_text.args[0] == account.object_path, e_observe_text.args assert e_observe_text.args[1] == conn.object_path, e_observe_text.args - assert e_observe_text.args[3] == text_cdo_path, e_observe_text.args - assert e_observe_text.args[4] == [], e_observe_text.args - channels = e_observe_text.args[2] - assert len(channels) == 1, channels - assert (text_chan.object_path, text_channel_properties) in channels + assert e_observe_text.args[2] == text_chan.object_path, e_observe_text.args + assert e_observe_text.args[3] == text_channel_properties, e_observe_text.args + assert e_observe_text.args[4] == text_cdo_path, e_observe_text.args + assert e_observe_text.args[5] == [], e_observe_text.args assert k_observe_text.args[0] == e_observe_text.args[0], k_observe_text.args assert k_observe_text.args[1] == e_observe_text.args[1], k_observe_text.args - assert (k_observe_text.args[2] == - [(text_chan.object_path, text_channel_properties)]) + assert k_observe_text.args[2] == text_chan.object_path, k_observe_text.args + assert k_observe_text.args[3] == text_channel_properties, k_observe_text.args + + e_approve_text, k_approve_text = q.expect_many( + EventPattern('dbus-method-call', + path=empathy.object_path, + interface=cs.APPROVER, method='AddDispatchOperation', + predicate=lambda e: e.args[0] == text_cdo_path, + handled=False), + EventPattern('dbus-method-call', + path=kopete.object_path, + interface=cs.APPROVER, method='AddDispatchOperation', + handled=False), + ) + + assertEquals(text_cdo_path, e_approve_text.args[0]) + assertEquals(text_cdo_properties, e_approve_text.args[1]) + assertEquals(k_approve_text.args, e_approve_text.args) # Now a separate CDO is created for the media channel. @@ -185,47 +201,29 @@ def test(q, bus, mc): e_observe_media = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e_observe_media.args[0] == account.object_path, e_observe_media.args assert e_observe_media.args[1] == conn.object_path, e_observe_media.args - assert e_observe_media.args[3] == media_cdo_path, e_observe_media.args - assert e_observe_media.args[4] == [], e_observe_media.args - channels = e_observe_media.args[2] - assert len(channels) == 1, channels - assert (media_chan.object_path, media_channel_properties) in channels + assert e_observe_media.args[2] == media_chan.object_path, e_observe_media.args + assert e_observe_media.args[3] == media_channel_properties, e_observe_media.args + assert e_observe_media.args[4] == media_cdo_path, e_observe_media.args + assert e_observe_media.args[5] == [], e_observe_media.args - # All Observers reply. + e_approve_media = q.expect('dbus-method-call', + path=empathy.object_path, + interface=cs.APPROVER, method='AddDispatchOperation', + predicate=lambda e: e.args[0] == media_cdo_path, + handled=False) + assertEquals(media_cdo_path, e_approve_media.args[0]) + assertEquals(media_cdo_properties, e_approve_media.args[1]) + + # All Observers reply. q.dbus_return(e_observe_text.message, signature='') q.dbus_return(k_observe_text.message, signature='') q.dbus_return(e_observe_media.message, signature='') - # The Approvers are next - e_approve_text, k_approve_text, e_approve_media = q.expect_many( - EventPattern('dbus-method-call', - path=empathy.object_path, - interface=cs.APPROVER, method='AddDispatchOperation', - predicate=lambda e: e.args[0] == text_cdo_path, - handled=False), - EventPattern('dbus-method-call', - path=kopete.object_path, - interface=cs.APPROVER, method='AddDispatchOperation', - handled=False), - EventPattern('dbus-method-call', - path=empathy.object_path, - interface=cs.APPROVER, method='AddDispatchOperation', - predicate=lambda e: e.args[0] == media_cdo_path, - handled=False) - ) - - assertEquals(text_cdo_path, e_approve_text.args[0]) - assertEquals(text_cdo_properties, e_approve_text.args[1]) - assertEquals(k_approve_text.args, e_approve_text.args) - - assertEquals(media_cdo_path, e_approve_media.args[0]) - assertEquals(media_cdo_properties, e_approve_media.args[1]) - q.dbus_return(e_approve_text.message, signature='') q.dbus_return(k_approve_text.message, signature='') q.dbus_return(e_approve_media.message, signature='') @@ -313,7 +311,10 @@ def test(q, bus, mc): ext_chan = SimulatedChannel(conn, ext_channel_properties, destroyable=False) - conn.NewChannels([text_chan, media_chan, ext_chan, respawning_chan]) + conn.NewChannel(text_chan) + conn.NewChannel(media_chan) + conn.NewChannel(ext_chan) + conn.NewChannel(respawning_chan) # No client can handle all four channels, so the bundle explodes into # two dispatch operations and two failures. We can only match the first @@ -323,18 +324,18 @@ def test(q, bus, mc): _, _, _ = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', - predicate=(lambda e: e.args[2][0][0] == media_chan.object_path), + interface=cs.OBSERVER, method='ObserveChannel', + predicate=(lambda e: e.args[2] == media_chan.object_path), handled=False), EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', - predicate=(lambda e: e.args[2][0][0] == text_chan.object_path), + interface=cs.OBSERVER, method='ObserveChannel', + predicate=(lambda e: e.args[2] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', - predicate=(lambda e: e.args[2][0][0] == text_chan.object_path), + interface=cs.OBSERVER, method='ObserveChannel', + predicate=(lambda e: e.args[2] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', path=empathy.object_path, diff --git a/tests/twisted/dispatcher/handle-channels-fails.py b/tests/twisted/dispatcher/handle-channels-fails.py index 5497b49f..3b8e1597 100644 --- a/tests/twisted/dispatcher/handle-channels-fails.py +++ b/tests/twisted/dispatcher/handle-channels-fails.py @@ -121,16 +121,15 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied + q.dbus_return(e.message, bus=empathy_bus, signature='') diff --git a/tests/twisted/dispatcher/lose-text.py b/tests/twisted/dispatcher/lose-text.py index 5d9c7b2d..4aa73350 100644 --- a/tests/twisted/dispatcher/lose-text.py +++ b/tests/twisted/dispatcher/lose-text.py @@ -105,19 +105,17 @@ def test(q, bus, mc): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args assert k.args == e.args diff --git a/tests/twisted/dispatcher/recover-from-disconnect.py b/tests/twisted/dispatcher/recover-from-disconnect.py index 7754ec1a..21420bfd 100644 --- a/tests/twisted/dispatcher/recover-from-disconnect.py +++ b/tests/twisted/dispatcher/recover-from-disconnect.py @@ -199,21 +199,19 @@ def test_dispatching(q, bus, conn, account, empathy, kopete): e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied assert k.args == e.args diff --git a/tests/twisted/dispatcher/respawn-activatable-observers.py b/tests/twisted/dispatcher/respawn-activatable-observers.py index 4257386a..2db7c8c7 100644 --- a/tests/twisted/dispatcher/respawn-activatable-observers.py +++ b/tests/twisted/dispatcher/respawn-activatable-observers.py @@ -138,17 +138,15 @@ def test(q, bus, mc): # Logger is told about the new channel e = q.expect('dbus-method-call', path=logger.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied # Logger indicates that it is ready to proceed q.dbus_return(e.message, bus=logger_bus, signature='') @@ -210,7 +208,7 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=logger.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) # FIXME: assert the same things as before, except CDO (which we don't @@ -218,12 +216,10 @@ def test(q, bus, mc): # that the recovering observer info key is set assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - assert e.args[5]['recovering'] == 1, e.args # due to observer recovery - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[5] == [], e.args # no requests satisfied + assert e.args[6]['recovering'] == 1, e.args # due to observer recovery # Logger indicates that it is ready to proceed q.dbus_return(e.message, bus=logger_bus, signature='') diff --git a/tests/twisted/dispatcher/respawn-observers.py b/tests/twisted/dispatcher/respawn-observers.py index 535226d1..a766a596 100644 --- a/tests/twisted/dispatcher/respawn-observers.py +++ b/tests/twisted/dispatcher/respawn-observers.py @@ -122,17 +122,15 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e.args[2] == chan.object_path, e.args + assert e.args[3] == channel_properties, e.args + assert e.args[4] == cdo_path, e.args + assert e.args[5] == [], e.args # no requests satisfied # Empathy indicates that it is ready to proceed q.dbus_return(e.message, bus=empathy_bus, signature='') @@ -226,17 +224,15 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args - assert e.args[3] == cdo2_path, e.args - assert e.args[4] == [], e.args # no requests satisfied - channels = e.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan2.object_path, channels - assert channels[0][1] == channel2_properties, channels + assert e.args[2] == chan2.object_path, e.args + assert e.args[3] == channel2_properties, e.args + assert e.args[4] == cdo2_path, e.args + assert e.args[5] == [], e.args # no requests satisfied # Empathy indicates that it is ready to proceed q.dbus_return(e.message, bus=empathy_bus, signature='') @@ -277,33 +273,29 @@ def test(q, bus, mc): e1, e2 = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', - predicate=lambda e: e.args[2][0][0] == chan.object_path, + interface=cs.OBSERVER, method='ObserveChannel', + predicate=lambda e: e.args[2] == chan.object_path, handled=False), EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', - predicate=lambda e: e.args[2][0][0] == chan2.object_path, + interface=cs.OBSERVER, method='ObserveChannel', + predicate=lambda e: e.args[2] == chan2.object_path, handled=False), ) assert e1.args[0] == account.object_path, e1.args assert e1.args[1] == conn.object_path, e1.args - assert e1.args[4] == [], e1.args # no requests satisfied - assert e1.args[5]['recovering'] == 1, e1.args # due to observer recovery - channels = e1.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan.object_path, channels - assert channels[0][1] == channel_properties, channels + assert e1.args[2] == chan.object_path, e1.args + assert e1.args[3] == channel_properties, e1.args + assert e1.args[5] == [], e1.args # no requests satisfied + assert e1.args[6]['recovering'] == 1, e1.args # due to observer recovery assert e2.args[0] == account.object_path, e2.args assert e2.args[1] == conn.object_path, e2.args - assert e2.args[4] == [], e2.args # no requests satisfied - assert e2.args[5]['recovering'] == 1, e2.args # due to observer recovery - channels = e2.args[2] - assert len(channels) == 1, channels - assert channels[0][0] == chan2.object_path, channels - assert channels[0][1] == channel2_properties, channels + assert e2.args[2] == chan2.object_path, e1.args + assert e2.args[3] == channel2_properties, e1.args + assert e2.args[5] == [], e2.args # no requests satisfied + assert e2.args[6]['recovering'] == 1, e2.args # due to observer recovery # Empathy indicates that it is ready to proceed q.dbus_return(e1.message, bus=empathy_bus, signature='') diff --git a/tests/twisted/dispatcher/some-delay-approvers.py b/tests/twisted/dispatcher/some-delay-approvers.py index af5e2b97..4fb6c6d5 100644 --- a/tests/twisted/dispatcher/some-delay-approvers.py +++ b/tests/twisted/dispatcher/some-delay-approvers.py @@ -91,7 +91,7 @@ def test(q, bus, mc): # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from - # ObserveChannels. Because Loggy has DelayApprovers=False, + # ObserveChannel. Because Loggy has DelayApprovers=False, # however, ADO can be called on Kopete before Loggy returns, but # again, only after Empathy returns. forbidden = [EventPattern('dbus-method-call', @@ -101,11 +101,11 @@ def test(q, bus, mc): e, l = q.expect_many(EventPattern('dbus-method-call', path=empathy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), EventPattern('dbus-method-call', path=loggy.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False), ) @@ -115,7 +115,7 @@ def test(q, bus, mc): call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') - # Finally return from ObserveChannels from Empathy, so now we + # Finally return from ObserveChannel from Empathy, so now we # expect ADO to be called on Kopete. q.dbus_return(e.message, bus=bus, signature='') q.unforbid_events(forbidden) @@ -127,7 +127,7 @@ def test(q, bus, mc): q.dbus_return(e.message, bus=bus, signature='') - # Return from loggy's ObserveChannels. + # Return from loggy's ObserveChannel. q.dbus_return(l.message, bus=bus, signature='') # The user responds to Kopete diff --git a/tests/twisted/dispatcher/undispatchable.py b/tests/twisted/dispatcher/undispatchable.py index 8a18ec03..d98b9d93 100644 --- a/tests/twisted/dispatcher/undispatchable.py +++ b/tests/twisted/dispatcher/undispatchable.py @@ -94,7 +94,7 @@ def test(q, bus, mc): e = q.expect('dbus-method-call', path=client.object_path, - interface=cs.OBSERVER, method='ObserveChannels', + interface=cs.OBSERVER, method='ObserveChannel', handled=False) sync_dbus(bus, q, mc) diff --git a/tests/twisted/mctest.py b/tests/twisted/mctest.py index 3bfd66f6..444efb62 100644 --- a/tests/twisted/mctest.py +++ b/tests/twisted/mctest.py @@ -509,17 +509,15 @@ class SimulatedConnection(object): 'Channels': self.get_channel_details(), }, signature='a{sv}') - def NewChannels(self, channels): - for channel in channels: - assert not channel.announced - channel.announced = True - self.channels.append(channel) + def NewChannel(self, channel): + assert not channel.announced + channel.announced = True + self.channels.append(channel) self.q.dbus_emit(self.object_path, cs.CONN_IFACE_REQUESTS, - 'NewChannels', - [(channel.object_path, channel.immutable) - for channel in channels], - signature='a(oa{sv})') + 'NewChannel', + channel.object_path, channel.immutable, + signature='oa{sv}') def get_contact_attributes(self, h, ifaces): id = self.inspect_handles([h])[0] @@ -669,7 +667,7 @@ class SimulatedChannel(object): self.q.dbus_return(e.message, [], signature='a(uuus)') def announce(self): - self.conn.NewChannels([self]) + self.conn.NewChannel(self) def Close(self, e): if not self.closed: |