diff options
Diffstat (limited to 'tests/twisted/tubes/tubetestutil.py')
-rw-r--r-- | tests/twisted/tubes/tubetestutil.py | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py index 3c53d1533..092220df1 100644 --- a/tests/twisted/tubes/tubetestutil.py +++ b/tests/twisted/tubes/tubetestutil.py @@ -82,6 +82,9 @@ def check_conn_properties(q, conn, channel_list=None): assert i in properties['Channels'], \ (i, properties['Channels']) + properties = conn.GetAll( + cs.CONN, dbus_interface=cs.PROPERTIES_IFACE) + # 1-1 StreamTube channel assert ({cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAM_TUBE, cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT @@ -112,46 +115,6 @@ def check_conn_properties(q, conn, channel_list=None): ) in properties.get('RequestableChannelClasses'),\ properties['RequestableChannelClasses'] - -def check_NewChannel_signal(args, channel_type, chan_path, contact_handle, - suppress_handler): - """ - Checks the first argument, a tuple of arguments from NewChannel, matches - the other arguments. - """ - if chan_path is not None: - assert args[0] == chan_path, (args, chan_path) - assert args[1] == channel_type, (args, channel_type) - assert args[2] == cs.HT_CONTACT, (args, cs.HT_CONTACT) - assert args[3] == contact_handle, (args, contact_handle) - assert args[4] == suppress_handler, (args, suppress_handler) - -def check_NewChannels_signal(conn, args, channel_type, chan_path, contact_handle, - contact_id, initiator_handle): - """ - Checks the first argument, a one-tuple of arguments from NewChannels, - matches the other arguments. - """ - assert len(args) == 1, args - assert len(args[0]) == 1 # one channel - path, props = args[0][0] - - assert path == chan_path, (emitted_path, chan_path) - - assert props[cs.CHANNEL_TYPE] == channel_type, (props, channel_type) - assert props[cs.TARGET_HANDLE_TYPE] == cs.HT_CONTACT, props - assert props[cs.TARGET_HANDLE] == contact_handle, (props, contact_handle) - assert props[cs.TARGET_ID] == contact_id, (props, contact_id) - assert props[cs.REQUESTED] == True, props - assert props[cs.INITIATOR_HANDLE] == initiator_handle, \ - (props, initiator_handle) - assert props[cs.INITIATOR_ID] == 'test@localhost', props - - # check that the newly announced channel is in the channels list - all_channels = conn.Get(cs.CONN_IFACE_REQUESTS, 'Channels', - dbus_interface=cs.PROPERTIES_IFACE, byte_arrays=True) - assertContains((path, props), all_channels) - def check_platform_socket_types(sock_types): assertContains(cs.SOCKET_ADDRESS_TYPE_IPV4, sock_types) assertContains(cs.SOCKET_ADDRESS_TYPE_IPV6, sock_types) |