summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-05-16 17:40:02 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-05-16 17:41:20 +0100
commit33f0ab025272f54e613f84c68b09a4c2046b7409 (patch)
treec2ba45285c213b5023a7a9246f384187aa39b1ac /tests
parenteb9aa795c7f4047f93f785889955cbf40408c448 (diff)
muc-channel: validate Password properties to simplify {,un}setting branch
This is much better. I should have done this before. I also added some tests to make sure bad args are rejected. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/messages/room-config.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/twisted/messages/room-config.py b/tests/twisted/messages/room-config.py
index d8e5bdf..e18687d 100644
--- a/tests/twisted/messages/room-config.py
+++ b/tests/twisted/messages/room-config.py
@@ -240,6 +240,29 @@ def test_password(q, bus, conn, stream):
[]])
)
+ # get rid of it
+ call_async(q, chan.RoomConfig1, 'UpdateConfiguration',
+ {'PasswordProtected': False})
+ q.expect('stream-MODE', data=['#test', '-k']),
+
+ # try some wacky values
+ call_async(q, chan.RoomConfig1, 'UpdateConfiguration',
+ {'PasswordProtected': True})
+ q.expect('dbus-error', method='UpdateConfiguration',
+ name=cs.INVALID_ARGUMENT)
+
+ call_async(q, chan.RoomConfig1, 'UpdateConfiguration',
+ {'PasswordProtected': True,
+ 'Password': ''})
+ q.expect('dbus-error', method='UpdateConfiguration',
+ name=cs.INVALID_ARGUMENT)
+
+ call_async(q, chan.RoomConfig1, 'UpdateConfiguration',
+ {'PasswordProtected': False,
+ 'Password': 'scumbagsteve'})
+ q.expect('dbus-error', method='UpdateConfiguration',
+ name=cs.INVALID_ARGUMENT)
+
def test_modechanges(q, bus, conn, stream):
chan = setup(q, bus, conn, stream)