[telepathy-mission-control/master] account-manager/presence.py: don't assert about the ordering of SetPresence vs AccountPropertyChanged(CurrentPresence)

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Sep 18 05:10:45 PDT 2009


They might come out in either order, in fact (it's a race). The test seems
to be more likely to lose the race if MC is slow, for instance because
it's run under qemu (Scratchbox) or valgrind.

Also make the failure message clearer if things happen in the wrong order.
---
 test/twisted/account-manager/presence.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/test/twisted/account-manager/presence.py b/test/twisted/account-manager/presence.py
index f4b309e..f84c60e 100644
--- a/test/twisted/account-manager/presence.py
+++ b/test/twisted/account-manager/presence.py
@@ -77,13 +77,12 @@ def test(q, bus, mc):
                 EventPattern('dbus-signal', path=account.object_path,
                     interface=cs.ACCOUNT, signal='AccountPropertyChanged',
                     predicate=lambda e:
-                        e.args[0].get('CurrentPresence') == presence and
-                        (log.append('APC(CurrentPresence)') or True)),
+                        e.args[0].get('CurrentPresence') == presence),
                 ])
 
     # The events before Connect must happen in this order
     assert log == ['GetInterfaces', 'Get(Statuses)[1]', 'SetPresence[1]',
-            'Get(Statuses)[2]', 'SetPresence[2]', 'APC(CurrentPresence)']
+            'Get(Statuses)[2]', 'SetPresence[2]'], log
 
     # Change requested presence after going online
     presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AWAY), 'away',
-- 
1.5.6.5




More information about the telepathy-commits mailing list