From 68d883e4d7488bd2c692c8bc85e5b8f77950ba01 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 27 Sep 2011 16:37:44 +0100 Subject: 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. --- tests/twisted/account-manager/connectivity.py | 9 +++++++-- 1 file 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() -- cgit v1.2.3