telepathy-gabble: stop using GetAvatarTokens()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Fri Oct 11 14:58:34 PDT 2013


Module: telepathy-gabble
Branch: master
Commit: b7a7228c31557728d5133c23e380fcbc569a31e8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=b7a7228c31557728d5133c23e380fcbc569a31e8

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Oct  9 17:55:24 2013 -0400

stop using GetAvatarTokens()

---

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

diff --git a/tests/twisted/vcard/test-avatar-tokens.py b/tests/twisted/vcard/test-avatar-tokens.py
index 705fe38..281a733 100644
--- a/tests/twisted/vcard/test-avatar-tokens.py
+++ b/tests/twisted/vcard/test-avatar-tokens.py
@@ -5,7 +5,7 @@ Test GetAvatarTokens() and GetKnownAvatarTokens().
 
 from twisted.words.xish import domish
 
-from servicetest import unwrap, EventPattern
+from servicetest import unwrap, assertEquals
 from gabbletest import exec_test, make_result_iq
 import ns
 import constants as cs
@@ -44,8 +44,11 @@ def test(q, bus, conn, stream):
     handles = conn.get_contact_handles_sync([
         'amy at foo.com', 'bob at foo.com', 'che at foo.com', 'daf at foo.com' ])
 
-    tokens = unwrap(conn.Avatars.GetAvatarTokens(handles))
-    assert tokens == ['SHA1SUM-FOR-AMY', 'SHA1SUM-FOR-BOB', '', '']
+    h2asv = conn.Contacts.GetContactAttributes(handles, [cs.CONN_IFACE_AVATARS], False)
+    assertEquals('SHA1SUM-FOR-AMY', h2asv[handles[0]][cs.ATTR_AVATAR_TOKEN])
+    assertEquals('SHA1SUM-FOR-BOB', h2asv[handles[1]][cs.ATTR_AVATAR_TOKEN])
+    assertEquals('', h2asv[handles[2]][cs.ATTR_AVATAR_TOKEN])
+    assertEquals(None, h2asv[handles[3]].get(cs.ATTR_AVATAR_TOKEN))
 
     tokens = unwrap(conn.Avatars.GetKnownAvatarTokens(handles))
     tokens = sorted(tokens.items())



More information about the telepathy-commits mailing list