diff options
authorWill Thompson <>2010-12-22 11:04:25 (GMT)
committerWill Thompson <>2010-12-22 11:21:26 (GMT)
commit1d9f17613ac2ce1dc3928ab0848d7b9b987b6330 (patch)
parent9ad89fea078ea23178a99608fc18b753bd6f2005 (diff)
create-with-properties: remove unsound signal expectation
When this test creates a new account, it expects four events to occur: • A.AccountPropertyChanged, to say the new account is valid; • AM.AccountValidityChanged, to say the new account is valid; • CreateAccount returning successfully; • RequestConnection on the fake CM, because ConnectAutomatically was set to True and RequestedPresence was set to non-offline in CreateAccount. However, if the account's not yet been announced by AccountValidityChanged, MC has no reason to emit AccountPropertyChanged on it. It happens that, in some cases, it does; but this depends on whether or not MC has already introspected the fake CM by the time the account is created. So the test is wrong to expect AccountPropertyChanged. Instead, we check that Account.Valid is in sync with what AccountValidityChanged said. This fixes an issue where this test would only pass if it was run after account-manager/create-twice, but not if it was run individually.
1 files changed, 3 insertions, 5 deletions
diff --git a/test/twisted/account-manager/ b/test/twisted/account-manager/
index 787c7e0..5aabfc7 100644
--- a/test/twisted/account-manager/
+++ b/test/twisted/account-manager/
@@ -100,10 +100,7 @@ def test(q, bus, mc):
# FIXME: MC ought to also introspect the CM and find out that the params
# are in fact sufficient
- a_signal, am_signal, ret, rc = q.expect_many(
- EventPattern('dbus-signal',
- signal='AccountPropertyChanged', interface=cs.ACCOUNT,
- predicate=(lambda e: 'Valid' in e.args[0])),
+ am_signal, ret, rc = q.expect_many(
EventPattern('dbus-signal', path=cs.AM_PATH,
signal='AccountValidityChanged', interface=cs.AM),
EventPattern('dbus-return', method='CreateAccount'),
@@ -111,7 +108,6 @@ def test(q, bus, mc):
account_path = ret.value[0]
assert am_signal.args == [account_path, True], am_signal.args
- assert a_signal.args[0]['Valid'] == True, a_signal.args
assert account_path is not None
@@ -131,6 +127,8 @@ def test(q, bus, mc):
assert properties.get('Enabled') == True, \
+ assert properties.get('Valid') == True, \
+ properties.get('Valid')
assert properties.get('Icon') == 'quake3arena', \
assert properties.get('Nickname') == 'AnArKi', \