[Telepathy-commits] [telepathy-mission-control/master] tests: Set up some more realistic parameters for the fake CM

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Mar 25 11:50:09 PDT 2009


---
 test/twisted/telepathy/managers/fakecm.manager |   12 ++++++++++--
 test/twisted/test-account.py                   |    3 ++-
 test/twisted/test-connect.py                   |   17 ++++++++++++++---
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/test/twisted/telepathy/managers/fakecm.manager b/test/twisted/telepathy/managers/fakecm.manager
index 60a45cf..23a074e 100644
--- a/test/twisted/telepathy/managers/fakecm.manager
+++ b/test/twisted/telepathy/managers/fakecm.manager
@@ -3,5 +3,13 @@ BusName=com.example.FakeCM
 ObjectPath=/com/example/FakeCM/ConnectionManager
 
 [Protocol fakeprotocol]
-param-nickname=s
-
+param-account=s register required
+param-password=s register required secret
+param-nickname=s register
+param-register=b
+param-com.example.Badgerable.Badgered=b dbus-property
+param-secret-mushroom=s
+param-snakes=u
+default-register=0
+default-com.example.Badgerable.Badgered=0
+default-snakes=1
diff --git a/test/twisted/test-account.py b/test/twisted/test-account.py
index 2c29d65..954653d 100644
--- a/test/twisted/test-account.py
+++ b/test/twisted/test-account.py
@@ -38,7 +38,8 @@ def test(q, bus, mc):
             in interfaces, interfaces
 
     # Create an account
-    params = dbus.Dictionary({"nickname": "fakenick"}, signature='sv')
+    params = dbus.Dictionary({"account": "someguy at example.com",
+        "password": "secrecy"}, signature='sv')
     account_path = account_manager_iface.CreateAccount(
             'fakecm', # Connection_Manager
             'fakeprotocol', # Protocol
diff --git a/test/twisted/test-connect.py b/test/twisted/test-connect.py
index dbb6073..01702b6 100644
--- a/test/twisted/test-connect.py
+++ b/test/twisted/test-connect.py
@@ -38,7 +38,8 @@ def test(q, bus, mc):
             'org.freedesktop.Telepathy.AccountManager')
 
     # Create an account
-    params = dbus.Dictionary({"nickname": "fakenick"}, signature='sv')
+    params = dbus.Dictionary({"account": "someguy at example.com",
+        "password": "secrecy"}, signature='sv')
     account_path = account_manager_iface.CreateAccount(
             'fakecm', # Connection_Manager
             'fakeprotocol', # Protocol
@@ -54,6 +55,12 @@ def test(q, bus, mc):
     account_iface = dbus.Interface(account,
             'org.freedesktop.Telepathy.Account')
 
+    # The account is initially valid but disabled
+    assert not account.Get('org.freedesktop.Telepathy.Account', 'Enabled',
+            dbus_interface='org.freedesktop.DBus.Properties')
+    assert account.Get('org.freedesktop.Telepathy.Account', 'Valid',
+            dbus_interface='org.freedesktop.DBus.Properties')
+
     # Enable the account
     account.Set('org.freedesktop.Telepathy.Account',
             'Enabled', True,
@@ -61,8 +68,12 @@ def test(q, bus, mc):
     q.expect('dbus-signal',
             path=account_path,
             signal='AccountPropertyChanged',
-            interface='org.freedesktop.Telepathy.Account',
-            args=[dbus.Dictionary({"Enabled": True}, signature='sv')])
+            interface='org.freedesktop.Telepathy.Account')
+
+    assert account.Get('org.freedesktop.Telepathy.Account', 'Enabled',
+            dbus_interface='org.freedesktop.DBus.Properties')
+    assert account.Get('org.freedesktop.Telepathy.Account', 'Valid',
+            dbus_interface='org.freedesktop.DBus.Properties')
 
     # Check the requested presence is offline
     properties = account.GetAll(
-- 
1.5.6.5




More information about the telepathy-commits mailing list