summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-03-25 16:17:12 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2011-03-25 16:17:12 +0000
commitf246140fac18edc2975f85933d0203a797244ec4 (patch)
treef04839f1130e29487fa93ee38cd4d8f9742f4d69
parent418996606b95598d9392f1ec07d7115fac040580 (diff)
Test validating the 'username' parameter.
-rw-r--r--tests/twisted/cm/protocol.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/twisted/cm/protocol.py b/tests/twisted/cm/protocol.py
index 85e5430..8fa3ece 100644
--- a/tests/twisted/cm/protocol.py
+++ b/tests/twisted/cm/protocol.py
@@ -52,5 +52,14 @@ def test(q, bus, conn, server):
acc_name = unwrap(proto_iface.IdentifyAccount(test_params))
assertEquals('robot101@irc.oftc.net', acc_name)
+ # Test validating 'username'
+ test_params = {
+ 'account': 'Robot101',
+ 'server': 'irc.oftc.net',
+ 'username': '@@@\n\n\n',
+ }
+ call_async(q, proto_iface, 'IdentifyAccount', test_params)
+ q.expect('dbus-error', method='IdentifyAccount', name=cs.INVALID_ARGUMENT)
+
if __name__ == '__main__':
exec_test(test)