[telepathy-gabble/telepathy-gabble-0.8] test-avatar-async.py: check that the avatar cache still works after conflict resolution

Alban Crequy alban.crequy at collabora.co.uk
Fri Oct 2 08:15:25 PDT 2009


---
 tests/twisted/vcard/test-avatar-async.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/vcard/test-avatar-async.py b/tests/twisted/vcard/test-avatar-async.py
index 1cddaf3..f288eaa 100644
--- a/tests/twisted/vcard/test-avatar-async.py
+++ b/tests/twisted/vcard/test-avatar-async.py
@@ -158,5 +158,14 @@ def test(q, bus, conn, stream):
     assertEquals(self_handle, event.args[0])
     assertEquals(hashlib.sha1('\o/').hexdigest(), event.args[1])
 
+    # Gabble must reply without asking the vCard to the server because the
+    # avatar must be in the cache
+    q.forbid_events([avatar_request_event])
+    data, mime = conn.Avatars.RequestAvatar(self_handle, byte_arrays=True)
+    assertEquals('\o/', data)
+    data, mime = conn.Avatars.RequestAvatar(handle, byte_arrays=True)
+    assertEquals('hello', data)
+    q.unforbid_events([avatar_request_event])
+
 if __name__ == '__main__':
     exec_test(test)
-- 
1.5.6.5




More information about the telepathy-commits mailing list