1
# Copyright (C) 2009 Nokia Corporation
2
# Copyright (C) 2009 Collabora Ltd.
4
# This library is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU Lesser General Public
6
# License as published by the Free Software Foundation; either
7
# version 2.1 of the License, or (at your option) any later version.
9
# This library is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
# Lesser General Public License for more details.
14
# You should have received a copy of the GNU Lesser General Public
15
# License along with this library; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23
from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
25
from mctest import exec_test, create_fakecm_account
26
import constants as cs
29
params = dbus.Dictionary({"account": "smcv@example.com",
30
"password": "secrecy"}, signature='sv')
31
(cm_name_ref, account) = create_fakecm_account(q, bus, mc, params)
33
account_iface = dbus.Interface(account, cs.ACCOUNT)
34
account_props = dbus.Interface(account, cs.PROPERTIES_IFACE)
36
call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence',
37
(dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', ''))
38
q.expect('dbus-return', method='Set')
40
call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', False)
41
q.expect('dbus-return', method='Set')
43
call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically',
45
q.expect('dbus-return', method='Set')
47
call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence',
48
(dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing Enabled'))
49
q.expect('dbus-return', method='Set')
51
# Go online by setting Enabled
52
call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', True)
54
e = q.expect('dbus-method-call', method='RequestConnection',
55
args=['fakeprotocol', params],
56
destination=cs.tp_name_prefix + '.ConnectionManager.fakecm',
57
path=cs.tp_path_prefix + '/ConnectionManager/fakecm',
58
interface=cs.tp_name_prefix + '.ConnectionManager',
61
if __name__ == '__main__':