summaryrefslogtreecommitdiff
path: root/tests/twisted/account-manager/bad-cm.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/twisted/account-manager/bad-cm.py')
-rw-r--r--tests/twisted/account-manager/bad-cm.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/twisted/account-manager/bad-cm.py b/tests/twisted/account-manager/bad-cm.py
index 74277b46..008ac605 100644
--- a/tests/twisted/account-manager/bad-cm.py
+++ b/tests/twisted/account-manager/bad-cm.py
@@ -22,11 +22,12 @@
import dbus
from servicetest import call_async, assertEquals, assertContains
-from mctest import exec_test, AccountManager
+from mctest import (exec_test, SimulatedConnectionManager, AccountManager)
import constants as cs
def test(q, bus, mc):
am = AccountManager(bus)
+ simulated_cm = SimulatedConnectionManager(q, bus)
def call_create(cm='fakecm', protocol='fakeprotocol', parameters=None):
if parameters is None:
@@ -74,5 +75,13 @@ def test(q, bus, mc):
assertEquals(cs.INVALID_ARGUMENT, e.name)
assertContains("password", e.message)
+ # Create an account that will fail IdentifyAccount
+ call_create(parameters={ "account": "",
+ "password": "ohai",
+ })
+ e = q.expect('dbus-error', method='CreateAccount')
+ assertEquals(cs.INVALID_HANDLE, e.name)
+ assertContains("Invalid account name", e.message)
+
if __name__ == '__main__':
exec_test(test, {})