[telepathy-mission-control/master] account-manager/create-with-properties.py: test setting RequestedPresence at creation and assert that the account starts to go online
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu Jun 25 10:46:21 PDT 2009
---
.../account-manager/create-with-properties.py | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/test/twisted/account-manager/create-with-properties.py b/test/twisted/account-manager/create-with-properties.py
index 16035be..fbd3f49 100644
--- a/test/twisted/account-manager/create-with-properties.py
+++ b/test/twisted/account-manager/create-with-properties.py
@@ -41,8 +41,7 @@ def test(q, bus, mc):
assert (cs.ACCOUNT_IFACE_NOKIA_COMPAT + '.SecondaryVCardFields') in supported
assert (cs.ACCOUNT_IFACE_NOKIA_CONDITIONS + '.Condition') in supported
- # FIXME: setting RequestedPresence at create time doesn't work yet
- #assert (cs.ACCOUNT + '.RequestedPresence') in supported
+ assert (cs.ACCOUNT + '.RequestedPresence') in supported
params = dbus.Dictionary({"account": "anarki at example.com",
"password": "secrecy"}, signature='sv')
@@ -57,6 +56,9 @@ def test(q, bus, mc):
cs.ACCOUNT + '.AutomaticPresence': dbus.Struct((
dbus.UInt32(cs.PRESENCE_TYPE_BUSY),
'busy', 'Exploding'), signature='uss'),
+ cs.ACCOUNT + '.RequestedPresence': dbus.Struct((
+ dbus.UInt32(cs.PRESENCE_TYPE_AWAY),
+ 'away', 'Respawning'), signature='uss'),
cs.ACCOUNT + '.Icon': 'quake3arena',
cs.ACCOUNT + '.Nickname': 'AnArKi',
cs.ACCOUNT + '.ConnectAutomatically': True,
@@ -80,13 +82,14 @@ 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 = q.expect_many(
+ 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])),
EventPattern('dbus-signal', path=cs.AM_PATH,
signal='AccountValidityChanged', interface=cs.AM),
EventPattern('dbus-return', method='CreateAccount'),
+ EventPattern('dbus-method-call', method='RequestConnection'),
)
account_path = ret.value[0]
assert am_signal.args == [account_path, True], am_signal.args
@@ -103,6 +106,9 @@ def test(q, bus, mc):
assert properties.get('AutomaticPresence') == (cs.PRESENCE_TYPE_BUSY,
'busy', 'Exploding'), \
properties.get('AutomaticPresence')
+ assert properties.get('RequestedPresence') == (cs.PRESENCE_TYPE_AWAY,
+ 'away', 'Respawning'), \
+ properties.get('RequestedPresence')
assert properties.get('ConnectAutomatically') == True, \
properties.get('ConnectAutomatically')
assert properties.get('Enabled') == True, \
--
1.5.6.5
More information about the telepathy-commits
mailing list