summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-03 19:44:08 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-10 11:34:08 +0100
commit9becae7459f2762217f08eadc53ac0f9a85ab693 (patch)
tree24ce162199c266622df3b5ff14fb7f90174c6622
parent82abc7249f071d86b3ac7b9e5a7f9815372c041b (diff)
downloadtelepathy-mission-control-9becae7459f2762217f08eadc53ac0f9a85ab693.tar.gz
List Service and Hidden in create-time account properties
Also test them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33127 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--src/mcd-account-manager.c2
-rw-r--r--tests/twisted/account-manager/create-with-properties.py5
-rw-r--r--tests/twisted/account-manager/hidden.py6
3 files changed, 12 insertions, 1 deletions
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 3371a455..57296cd8 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -1066,9 +1066,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 f4a69828..6e208806 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 cdb59a22..9e9351b0 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 }