diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-16 18:30:56 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-16 18:30:56 +0100 |
commit | 6ff9e1a08d0a3c24e68cb1b65289eb95e7060359 (patch) | |
tree | 4ab553a0fdb6be13ffa2064f0bb4a0e5e7c93dd7 /tests | |
parent | a66b3c0c7ded54ca407439871d87b7fbd20535e8 (diff) | |
download | telepathy-idle-6ff9e1a08d0a3c24e68cb1b65289eb95e7060359.tar.gz |
room-config: flicker CanUpdateConfiguration but keep MutableProperties stable
I had misunderstood these two properties before, yet again. This is
better and easier. I added more tests.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/messages/room-config.py | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/tests/twisted/messages/room-config.py b/tests/twisted/messages/room-config.py index e18687d..12f2d0f 100644 --- a/tests/twisted/messages/room-config.py +++ b/tests/twisted/messages/room-config.py @@ -43,12 +43,7 @@ def setup(q, bus, conn, stream, op_user=True): args=[cs.GF_MESSAGE_REMOVE | cs.GF_CAN_REMOVE, 0]), EventPattern('dbus-signal', signal='PropertiesChanged', args=[cs.CHANNEL_IFACE_ROOM_CONFIG, - {'MutableProperties': ['InviteOnly', - 'Limit', - 'Moderated', - 'Private', - 'PasswordProtected', - 'Password']}, + {'CanUpdateConfiguration': True}, []])) return chan @@ -80,6 +75,15 @@ def test_props_present(q, bus, conn, stream): sync_stream(q, stream) q.unforbid_events(forbidden) + # we should have these mutable ones + mutable_props = ['InviteOnly', + 'Limit', + 'Moderated', + 'Private', + 'PasswordProtected', + 'Password'] + assertEquals(mutable_props, props['MutableProperties']) + def test_simple_bools(q, bus, conn, stream): chan = setup(q, bus, conn, stream) @@ -336,7 +340,21 @@ def test_mode_no_op(q, bus, conn, stream): {key: val}) q.expect('dbus-error', method='UpdateConfiguration', - name=cs.NOT_IMPLEMENTED) + name=cs.PERMISSION_DENIED) + + # op the user + change_channel_mode(stream, '+o test') + q.expect('dbus-signal', signal='PropertiesChanged', + args=[cs.CHANNEL_IFACE_ROOM_CONFIG, + {'CanUpdateConfiguration': True}, + []]) + + # remove ops again + change_channel_mode(stream, '-o test') + q.expect('dbus-signal', signal='PropertiesChanged', + args=[cs.CHANNEL_IFACE_ROOM_CONFIG, + {'CanUpdateConfiguration': False}, + []]) if __name__ == '__main__': exec_test(test_props_present) |