diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2010-06-14 15:17:04 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2010-06-14 15:17:04 +0100 |
commit | 98be6decabde18758bc56ae41431a19964e637cc (patch) | |
tree | 88d09e41028f86c3ed68283facba468455c78f15 | |
parent | a69216bb1030532e72a9d2a6b147890025125390 (diff) |
Unrace FT tests waiting for NewChannels
The buildbot hit this failure:
File ".../jingle-share/file_transfer_helper.py", line 259, in check_new_channel
assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER, props
AssertionError: {...,
u'org.freedesktop.Telepathy.Channel.ChannelType':
u'org.freedesktop.Telepathy.Channel.Type.ContactList', ... }
FAIL: jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py
This is because the tests waited for any NewChannels signal, and then
asserted that it's the FT channel we're expecting. But in fact, it's a
roster channel. This patch fixes both copies of file_transfer_helper.py.
-rw-r--r-- | tests/twisted/file-transfer/file_transfer_helper.py | 14 | ||||
-rw-r--r-- | tests/twisted/jingle-share/file_transfer_helper.py | 16 |
2 files changed, 26 insertions, 4 deletions
diff --git a/tests/twisted/file-transfer/file_transfer_helper.py b/tests/twisted/file-transfer/file_transfer_helper.py index afb41309c..049e150d5 100644 --- a/tests/twisted/file-transfer/file_transfer_helper.py +++ b/tests/twisted/file-transfer/file_transfer_helper.py @@ -179,7 +179,19 @@ class ReceiveFileTest(FileTransferTest): iq.send() def check_new_channel(self): - e = self.q.expect('dbus-signal', signal='NewChannels') + def is_ft_channel_event(event): + channels, = event.args + + if len(channels) > 1: + return False + + path, props = channels[0] + return props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER + + e = self.q.expect('dbus-signal', signal='NewChannels', + path=self.conn.object.object_path, + predicate=is_ft_channel_event) + channels = e.args[0] assert len(channels) == 1 path, props = channels[0] diff --git a/tests/twisted/jingle-share/file_transfer_helper.py b/tests/twisted/jingle-share/file_transfer_helper.py index e677d0745..342cf98d3 100644 --- a/tests/twisted/jingle-share/file_transfer_helper.py +++ b/tests/twisted/jingle-share/file_transfer_helper.py @@ -248,10 +248,20 @@ class ReceiveFileTest(FileTransferTest): self.close_channel, self.done] def check_new_channel(self): + def is_ft_channel_event(event): + channels, = event.args + + if len(channels) > 1: + return False + + path, props = channels[0] + return props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER + e = self.q.expect('dbus-signal', signal='NewChannels', - path=self.conn.object.object_path) - channels = e.args[0] - assert len(channels) == 1 + path=self.conn.object.object_path, + predicate=is_ft_channel_event) + + channels, = e.args path, props = channels[0] # check channel properties |