telepathy-mission-control: List Service and Hidden in create-time account properties

Simon McVittie smcv at kemper.freedesktop.org
Tue Sep 10 03:39:24 PDT 2013


Module: telepathy-mission-control
Branch: master
Commit: 9becae7459f2762217f08eadc53ac0f9a85ab693
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=9becae7459f2762217f08eadc53ac0f9a85ab693

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Tue Sep  3 19:44:08 2013 +0100

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 at collabora.co.uk>

---

 src/mcd-account-manager.c                          |    2 ++
 .../account-manager/create-with-properties.py      |    5 ++++-
 tests/twisted/account-manager/hidden.py            |    6 ++++++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 3371a45..57296cd 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 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 at 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 at porti.co", "password": "tollgate" }
     properties = { cs.ACCOUNT_IFACE_HIDDEN + '.Hidden': True }



More information about the telepathy-commits mailing list