From ab7dc067f7f182c39127057560ff2636f148a907 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 3 Sep 2013 19:44:08 +0100 Subject: [PATCH] List Service and Hidden in create-time account properties Also test them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33127 --- src/mcd-account-manager.c | 2 ++ tests/twisted/account-manager/create-with-properties.py | 5 ++++- tests/twisted/account-manager/hidden.py | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index 2948225..93cecee 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -1065,9 +1065,11 @@ get_supported_account_properties (TpSvcDBusProperties *svc, TP_IFACE_ACCOUNT ".ConnectAutomatically", TP_IFACE_ACCOUNT ".RequestedPresence", TP_IFACE_ACCOUNT ".Supersedes", + TP_PROP_ACCOUNT_SERVICE, TP_IFACE_ACCOUNT_INTERFACE_AVATAR ".Avatar", MC_IFACE_ACCOUNT_INTERFACE_CONDITIONS ".Condition", TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER, + MC_IFACE_ACCOUNT_INTERFACE_HIDDEN ".Hidden", NULL }; diff --git a/tests/twisted/account-manager/create-with-properties.py b/tests/twisted/account-manager/create-with-properties.py index f4a6982..6e20880 100644 --- a/tests/twisted/account-manager/create-with-properties.py +++ b/tests/twisted/account-manager/create-with-properties.py @@ -21,7 +21,7 @@ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ - call_async, assertEquals + call_async, assertEquals, assertContains from mctest import exec_test, create_fakecm_account, AccountManager import constants as cs @@ -49,6 +49,7 @@ def test(q, bus, mc): assert (cs.ACCOUNT + '.RequestedPresence') in supported assert (cs.ACCOUNT + '.Supersedes') in supported + assertContains(cs.ACCOUNT + '.Service', supported) params = dbus.Dictionary({"account": "anarki@example.com", "password": "secrecy"}, signature='sv') @@ -75,6 +76,7 @@ def test(q, bus, mc): cs.ACCOUNT_PATH_PREFIX + 'q1/q1/Ranger', cs.ACCOUNT_PATH_PREFIX + 'q2/q2/Grunt', ], signature='o'), + cs.ACCOUNT + '.Service': 'arena', }, signature='sv') call_async(q, account_manager, 'CreateAccount', @@ -127,6 +129,7 @@ def test(q, bus, mc): cs.ACCOUNT_PATH_PREFIX + 'q2/q2/Grunt', ], signature='o'), properties.get('Supersedes')) + assertEquals('arena', properties.get('Service')) properties = account_props.GetAll(cs.ACCOUNT_IFACE_AVATAR) assert properties.get('Avatar') == ([ord('f'), ord('o'), ord('o')], diff --git a/tests/twisted/account-manager/hidden.py b/tests/twisted/account-manager/hidden.py index cdb59a2..9e9351b 100644 --- a/tests/twisted/account-manager/hidden.py +++ b/tests/twisted/account-manager/hidden.py @@ -23,6 +23,7 @@ from mctest import ( ) from servicetest import ( EventPattern, assertEquals, assertContains, assertDoesNotContain, + call_async, ) import constants as cs @@ -50,6 +51,11 @@ def test_create_hidden_account(q, bus, mc): """ am = AccountManager(bus) + call_async(q, am.Properties, 'Get', cs.AM, + 'SupportedAccountProperties') + supported = q.expect('dbus-return', method='Get').value[0] + assertContains(cs.ACCOUNT_IFACE_HIDDEN + '.Hidden', supported) + # Make a new hidden account, and check that it really is hidden. params = { "account": "aperture@porti.co", "password": "tollgate" } properties = { cs.ACCOUNT_IFACE_HIDDEN + '.Hidden': True } -- 1.8.4.rc3