summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-09-27 16:37:44 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-09-28 11:32:20 +0100
commit68d883e4d7488bd2c692c8bc85e5b8f77950ba01 (patch)
tree402841932f6a0a1923297cef461f06fb331ab38e
parentfd8b6fe898130d6de44501e83629f188a3f3391a (diff)
am/connectivity: check for SetPresence call
I'd like to be sure that setting RequestedPresence before the network connection comes up causes that presence to be applied when it does, as opposed to just that the account be brought online.
-rw-r--r--tests/twisted/account-manager/connectivity.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/twisted/account-manager/connectivity.py b/tests/twisted/account-manager/connectivity.py
index 5b9953d6..913e1809 100644
--- a/tests/twisted/account-manager/connectivity.py
+++ b/tests/twisted/account-manager/connectivity.py
@@ -55,8 +55,9 @@ def test(q, bus, mc):
# connect automatically, to check that none of these make it sign in.
call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', True)
q.expect('dbus-return', method='Set')
+ requested_presence = (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'gtfo')
call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'RequestedPresence',
- (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'hlaghalgh'))
+ requested_presence)
q.expect('dbus-return', method='Set')
call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'ConnectAutomatically',
True)
@@ -68,7 +69,11 @@ def test(q, bus, mc):
# Okay, I'm satisfied. Turn the network on.
mc.connectivity.go_online()
- expect_fakecm_connection(q, bus, mc, account, params)
+ expect_fakecm_connection(q, bus, mc, account, params, has_presence=True,
+ expect_before_connect=[
+ EventPattern('dbus-method-call', method='SetPresence',
+ args=list(requested_presence[1:])),
+ ])
# If we turn the network off, the connection should be banished.
mc.connectivity.go_offline()