[telepathy-mission-control/master] auto-connect: be less strict about ordering of events
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu Sep 3 11:32:20 PDT 2009
Now that we "pre-load" presence, CurrentPresence can change sooner; so,
don't expect the signal (it can happen at basically any time), but just
do a Get for the property at the end.
---
test/twisted/account-manager/auto-connect.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/test/twisted/account-manager/auto-connect.py b/test/twisted/account-manager/auto-connect.py
index c6ebda0..9bafd0c 100644
--- a/test/twisted/account-manager/auto-connect.py
+++ b/test/twisted/account-manager/auto-connect.py
@@ -86,6 +86,9 @@ def test(q, bus, mc):
q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so')
account_path = (cs.tp_path_prefix + '/Account/' + account_id)
+ account = bus.get_object(
+ cs.tp_name_prefix + '.AccountManager',
+ account_path)
e, _ = q.expect_many(
EventPattern('dbus-signal', signal='AccountPropertyChanged',
@@ -122,12 +125,8 @@ def test(q, bus, mc):
assert e.args[0]['ConnectionStatus'] == cs.CONN_STATUS_CONNECTED
- e = q.expect('dbus-signal', signal='AccountPropertyChanged',
- path=account_path, interface=cs.ACCOUNT,
- predicate=lambda e: 'CurrentPresence' in e.args[0]
- and e.args[0]['CurrentPresence'][2] != '')
-
- assert e.args[0]['CurrentPresence'] == (cs.PRESENCE_TYPE_AVAILABLE,
+ assert account.Get(cs.ACCOUNT, 'CurrentPresence',
+ dbus_interface=cs.PROPERTIES_IFACE) == (cs.PRESENCE_TYPE_AVAILABLE,
'available', 'My vision is augmented')
q.dbus_return(set_aliases.message, signature='')
--
1.5.6.5
More information about the telepathy-commits
mailing list