[telepathy-mission-control/refs/tags/5.0.beta64] test-account.py: create account asynchronously and assert that AccountValidityChanged is emitted

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Mar 25 12:27:48 PDT 2009


---
 test/twisted/test-account.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/test/twisted/test-account.py b/test/twisted/test-account.py
index d76dbcf..a49c0b7 100644
--- a/test/twisted/test-account.py
+++ b/test/twisted/test-account.py
@@ -37,12 +37,21 @@ def test(q, bus, mc):
     # Create an account
     params = dbus.Dictionary({"account": "someguy at example.com",
         "password": "secrecy"}, signature='sv')
-    account_path = account_manager_iface.CreateAccount(
+    call_async(q, account_manager_iface, 'CreateAccount',
             'fakecm', # Connection_Manager
             'fakeprotocol', # Protocol
             'fakeaccount', #Display_Name
             params, # Parameters
             )
+    # the spec has no order guarantee here
+    signal, ret = q.expect_many(
+            EventPattern('dbus-signal', path=cs.AM_PATH,
+                signal='AccountValidityChanged', interface=cs.AM),
+            EventPattern('dbus-return', method='CreateAccount'),
+            )
+    account_path = ret.value[0]
+    assert signal.args == [account_path, True], signal.args
+
     assert account_path is not None
 
     # Check the account is correctly created
-- 
1.5.6.5




More information about the telepathy-commits mailing list