diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-01-21 14:22:54 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-01-29 14:34:54 +0100 |
commit | 14663f4749271a1fe95bde5249d466ce4d76d873 (patch) | |
tree | d50dd4dd145a3a6ab93c9e0351860d7c59b6e233 | |
parent | 38f0833d8acc454720cd45447fedd87e9c816c47 (diff) |
update for new spec
- NewChannels -> NewChannel
- RequestableChannelClasses is now in Connection
- Call. add InitialTones property
-rw-r--r-- | tests/twisted/channels/join-muc-channel-bouncer.py | 12 | ||||
-rw-r--r-- | tests/twisted/channels/join-muc-channel.py | 6 | ||||
-rw-r--r-- | tests/twisted/channels/requests-create.py | 20 | ||||
-rw-r--r-- | tests/twisted/channels/requests-muc.py | 12 | ||||
-rw-r--r-- | tests/twisted/channels/room-list-channel.py | 7 | ||||
-rw-r--r-- | tests/twisted/channels/room-list-multiple.py | 7 | ||||
-rw-r--r-- | tests/twisted/connect/connect-close-ssl.py | 5 | ||||
-rw-r--r-- | tests/twisted/connect/connect-reject-ssl.py | 5 | ||||
-rw-r--r-- | tests/twisted/connect/connect-success-ssl.py | 5 | ||||
-rw-r--r-- | tests/twisted/connect/disconnect-during-cert-verification.py | 2 | ||||
-rw-r--r-- | tests/twisted/messages/contactinfo-request.py | 2 |
11 files changed, 33 insertions, 50 deletions
diff --git a/tests/twisted/channels/join-muc-channel-bouncer.py b/tests/twisted/channels/join-muc-channel-bouncer.py index 4b3fd7b..e135160 100644 --- a/tests/twisted/channels/join-muc-channel-bouncer.py +++ b/tests/twisted/channels/join-muc-channel-bouncer.py @@ -12,18 +12,16 @@ from constants import * def test_join_bouncer(q, conn, stream, room): stream.sendJoin(room) - new_channels = EventPattern('dbus-signal', signal='NewChannels') - event = q.expect_many(new_channels)[0] - q.forbid_events([new_channels]) - channel_details = event.args[0] - assertEquals(1, len(channel_details)) - path, props = channel_details[0] + new_channel = EventPattern('dbus-signal', signal='NewChannel') + event = q.expect_many(new_channel)[0] + q.forbid_events([new_channel]) + path, props = event.args assertEquals(HT_ROOM, props[TARGET_HANDLE_TYPE]) assertEquals(CHANNEL_TYPE_TEXT, props[CHANNEL_TYPE]) q.expect('dbus-signal', signal='MembersChanged') - q.unforbid_events([new_channels]) + q.unforbid_events([new_channel]) return path def test(q, bus, conn, stream): diff --git a/tests/twisted/channels/join-muc-channel.py b/tests/twisted/channels/join-muc-channel.py index a6b6691..7699bec 100644 --- a/tests/twisted/channels/join-muc-channel.py +++ b/tests/twisted/channels/join-muc-channel.py @@ -25,12 +25,10 @@ def test(q, bus, conn, stream): event = q.expect('dbus-return', method='CreateChannel') obj_path = event.value[0] - pattern = EventPattern('dbus-signal', signal='NewChannels') + pattern = EventPattern('dbus-signal', signal='NewChannel') event = q.expect_many(pattern)[0] q.forbid_events([pattern]) - channel_details = event.args[0] - assert len(channel_details) == 1 - path, props = channel_details[0] + path, props = event.args assert path == obj_path assert props[TARGET_HANDLE_TYPE] == HT_ROOM assert props[CHANNEL_TYPE] == CHANNEL_TYPE_TEXT diff --git a/tests/twisted/channels/requests-create.py b/tests/twisted/channels/requests-create.py index 90ee8a1..e762507 100644 --- a/tests/twisted/channels/requests-create.py +++ b/tests/twisted/channels/requests-create.py @@ -23,6 +23,9 @@ def test(q, bus, conn, stream): properties = conn.GetAll(cs.CONN_IFACE_REQUESTS, dbus_interface=cs.PROPERTIES_IFACE) assert properties.get('Channels') == [], properties['Channels'] + + properties = conn.GetAll(cs.CONN, + dbus_interface=cs.PROPERTIES_IFACE) assert ({cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT, cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, }, @@ -39,7 +42,7 @@ def test(q, bus, conn, stream): ret, new_sig = q.expect_many( EventPattern('dbus-return', method='CreateChannel'), - EventPattern('dbus-signal', signal='NewChannels'), + EventPattern('dbus-signal', signal='NewChannel'), ) assert len(ret.value) == 2 @@ -52,17 +55,13 @@ def test(q, bus, conn, stream): assert emitted_props[cs.INITIATOR_HANDLE] == props['SelfHandle'] assert emitted_props[cs.INITIATOR_ID] == stream.nick - assert len(new_sig.args) == 1 - assert len(new_sig.args[0]) == 1 # one channel - assert len(new_sig.args[0][0]) == 2 # two struct members - assert new_sig.args[0][0][0] == ret.value[0] - assert new_sig.args[0][0][1] == ret.value[1] + assert new_sig.args[0] == ret.value[0] + assert new_sig.args[1] == ret.value[1] properties = conn.GetAll(cs.CONN_IFACE_REQUESTS, dbus_interface=cs.PROPERTIES_IFACE) - assert new_sig.args[0][0] in properties['Channels'], \ - (new_sig.args[0][0], properties['Channels']) + assertContains((new_sig.args[0], new_sig.args[1]), properties['Channels']) chan = make_channel_proxy(conn, path, 'Channel') @@ -74,9 +73,8 @@ def test(q, bus, conn, stream): # It should close and respawn! q.expect('dbus-signal', signal='ChannelClosed') - chans, = q.expect('dbus-signal', signal='NewChannels').args - assert len(chans) == 1 - new_props = chans[0][1] + e = q.expect('dbus-signal', signal='NewChannel') + _, new_props = e.args # It should look pretty similar... assert new_props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_TEXT diff --git a/tests/twisted/channels/requests-muc.py b/tests/twisted/channels/requests-muc.py index aa861b8..19c9809 100644 --- a/tests/twisted/channels/requests-muc.py +++ b/tests/twisted/channels/requests-muc.py @@ -17,7 +17,7 @@ class DelayJoinServer(BaseIRCServer): return def build_request(conn, channel_name, use_room): - rccs = conn.Properties.Get(cs.CONN_IFACE_REQUESTS, + rccs = conn.Properties.Get(cs.CONN, 'RequestableChannelClasses') if use_room: @@ -77,7 +77,7 @@ def test(q, bus, conn, stream, use_room=False): EventPattern('dbus-return', method='CreateChannel'), EventPattern('dbus-return', method='EnsureChannel'), ) - nc = q.expect('dbus-signal', signal='NewChannels') + nc = q.expect('dbus-signal', signal='NewChannel') path, props = cc.value @@ -104,9 +104,7 @@ def test(q, bus, conn, stream, use_room=False): assert ec_path == path assert ec_props == props - channels = nc.args[0] - assert len(channels) == 1 - nc_path, nc_props = channels[0] + nc_path, nc_props = nc.args assert nc_path == path assert nc_props == props @@ -133,9 +131,9 @@ def test(q, bus, conn, stream, use_room=False): q.forbid_events(patterns) chan.Close() q.expect('dbus-signal', signal='Closed', path=chan.object_path) - e = q.expect('dbus-signal', signal='NewChannels') + e = q.expect('dbus-signal', signal='NewChannel') - path, props = e.args[0][0] + path, props = e.args assertEquals(chan.object_path, path) # We requested the channel originally, but we didn't request it popping # back up. diff --git a/tests/twisted/channels/room-list-channel.py b/tests/twisted/channels/room-list-channel.py index 5e8f335..ac2e031 100644 --- a/tests/twisted/channels/room-list-channel.py +++ b/tests/twisted/channels/room-list-channel.py @@ -52,16 +52,13 @@ def test(q, bus, conn, stream): assertEquals(cs.CHANNEL_TYPE_ROOM_LIST, properties[cs.CHANNEL_TYPE]) def looks_like_a_room_list(event): - channels, = event.args - if len(channels) != 1: - return False - path, props = channels[0] + path, props = event.args return props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_ROOM_LIST and \ props[cs.TARGET_HANDLE_TYPE] == cs.HT_NONE and \ props[cs.TARGET_ID] == '' - e = q.expect('dbus-signal', signal='NewChannels', + q.expect('dbus-signal', signal='NewChannel', predicate=looks_like_a_room_list) chan = bus.get_object(conn.bus_name, path) diff --git a/tests/twisted/channels/room-list-multiple.py b/tests/twisted/channels/room-list-multiple.py index 4099531..37e77fe 100644 --- a/tests/twisted/channels/room-list-multiple.py +++ b/tests/twisted/channels/room-list-multiple.py @@ -30,16 +30,13 @@ def test(q, bus, conn, stream): # verify that a new channel was created and signalled def looks_like_a_room_list(event): - channels, = event.args - if len(channels) != 1: - return False - path, props = channels[0] + path, props = event.args return props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_ROOM_LIST and \ props[cs.TARGET_HANDLE_TYPE] == cs.HT_NONE and \ props[cs.TARGET_ID] == '' - e = q.expect('dbus-signal', signal='NewChannels', + q.expect('dbus-signal', signal='NewChannel', predicate=looks_like_a_room_list) # FIXME: this is pretty questionable. diff --git a/tests/twisted/connect/connect-close-ssl.py b/tests/twisted/connect/connect-close-ssl.py index 6fecd50..6da3ab4 100644 --- a/tests/twisted/connect/connect-close-ssl.py +++ b/tests/twisted/connect/connect-close-ssl.py @@ -13,9 +13,8 @@ def test(q, bus, conn, stream): q.expect_many( EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]), EventPattern('irc-connected')) - e = q.expect('dbus-signal', signal='NewChannels') - channels = e.args[0] - path, props = channels[0] + e = q.expect('dbus-signal', signal='NewChannel') + path, props = e.args channel = wrap_channel(bus.get_object(conn.bus_name, path), cs.CHANNEL_TYPE_SERVER_TLS_CONNECTION) diff --git a/tests/twisted/connect/connect-reject-ssl.py b/tests/twisted/connect/connect-reject-ssl.py index 8028428..cd7d8e4 100644 --- a/tests/twisted/connect/connect-reject-ssl.py +++ b/tests/twisted/connect/connect-reject-ssl.py @@ -13,9 +13,8 @@ def test(q, bus, conn, stream): q.expect_many( EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]), EventPattern('irc-connected')) - e = q.expect('dbus-signal', signal='NewChannels') - channels = e.args[0] - path, props = channels[0] + e = q.expect('dbus-signal', signal='NewChannel') + path, props = e.args cert = bus.get_object (conn.bus_name, props[cs.TLS_CERT_PATH]) cert.Reject([(cs.TLS_REJECT_REASON_UNTRUSTED, cs.CERT_UNTRUSTED, {})], diff --git a/tests/twisted/connect/connect-success-ssl.py b/tests/twisted/connect/connect-success-ssl.py index 2c74545..7268792 100644 --- a/tests/twisted/connect/connect-success-ssl.py +++ b/tests/twisted/connect/connect-success-ssl.py @@ -13,9 +13,8 @@ def test(q, bus, conn, stream): q.expect_many( EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]), EventPattern('irc-connected')) - e = q.expect('dbus-signal', signal='NewChannels') - channels = e.args[0] - path, props = channels[0] + e = q.expect('dbus-signal', signal='NewChannel') + path, props = e.args cert = bus.get_object (conn.bus_name, props[cs.TLS_CERT_PATH]) cert.Accept() diff --git a/tests/twisted/connect/disconnect-during-cert-verification.py b/tests/twisted/connect/disconnect-during-cert-verification.py index 83fe004..a8c7957 100644 --- a/tests/twisted/connect/disconnect-during-cert-verification.py +++ b/tests/twisted/connect/disconnect-during-cert-verification.py @@ -12,7 +12,7 @@ def test(q, bus, conn, stream): q.expect_many( EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]), EventPattern('irc-connected')) - e = q.expect('dbus-signal', signal='NewChannels') + q.expect('dbus-signal', signal='NewChannel') conn.Disconnect() q.expect_many( diff --git a/tests/twisted/messages/contactinfo-request.py b/tests/twisted/messages/contactinfo-request.py index b5d9ba6..462b913 100644 --- a/tests/twisted/messages/contactinfo-request.py +++ b/tests/twisted/messages/contactinfo-request.py @@ -50,7 +50,7 @@ def test(q, bus, conn, stream): TARGET_ID: name }) q.expect('dbus-return', method='CreateChannel') - q.expect('dbus-signal', signal='NewChannels') + q.expect('dbus-signal', signal='NewChannel') contact_info = dbus.Interface(conn, CONN_IFACE_CONTACT_INFO) |