[telepathy-gabble/master] Correctly test non-emission of CapabilitiesChanged
Will Thompson
will.thompson at collabora.co.uk
Mon Jun 15 10:45:11 PDT 2009
This was trying to check that CapabilitiesChanged hadn't been emitted in
response to an IQ sent to Gabble. However, the IQ might not have reached
Gabble by the time of the assertion unless we sync the stream as well.
---
tests/twisted/test-caps-hash.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/twisted/test-caps-hash.py b/tests/twisted/test-caps-hash.py
index b759090..6695145 100644
--- a/tests/twisted/test-caps-hash.py
+++ b/tests/twisted/test-caps-hash.py
@@ -89,12 +89,12 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client):
event = q.expect('dbus-signal', signal='CapabilitiesChanged')
caps_changed_flag = False
+
# send bogus presence
presence = make_presence(contact, status='hello')
c = presence.addElement(('http://jabber.org/protocol/caps', 'c'))
c['node'] = client
- c['ver'] = 'KyuUmfhC34jP1sDjs489RjkJfsg=' # good hash
- c['ver'] = 'X' + c['ver'] # now the hash is broken
+ c['ver'] = 'ceci=nest=pas=une=hash'
c['hash'] = 'sha-1'
stream.send(presence)
@@ -114,8 +114,10 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client):
# don't receive any D-Bus signal
sync_dbus(bus, q, conn)
+ sync_stream(q, stream)
assert caps_changed_flag == False
+
# send presence with empty caps
presence = make_presence(contact, status='hello')
presence = presence_add_caps(presence, '0.0', client)
--
1.5.6.5
More information about the telepathy-commits
mailing list