telepathy-salut: SalutTest: stop using ContactList channels

Xavier Claessens xclaesse at kemper.freedesktop.org
Tue Sep 24 11:47:39 PDT 2013


Module: telepathy-salut
Branch: master
Commit: 01a24c642287c473e9d08955c1fef520043bff91
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=01a24c642287c473e9d08955c1fef520043bff91

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Fri Sep 20 13:18:02 2013 -0400

SalutTest: stop using ContactList channels

---

 tests/twisted/saluttest.py |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/tests/twisted/saluttest.py b/tests/twisted/saluttest.py
index d622131..fec5b1e 100644
--- a/tests/twisted/saluttest.py
+++ b/tests/twisted/saluttest.py
@@ -206,25 +206,14 @@ def wait_for_contact_list(q, conn):
     q.expect('dbus-signal', signal='NewChannel')
 
 def wait_for_contact_in_publish(q, bus, conn, contact_name):
-    publish_handle = conn.RequestHandles(cs.HT_LIST, ["publish"])[0]
-    publish = conn.RequestChannel(cs.CHANNEL_TYPE_CONTACT_LIST,
-        cs.HT_LIST, publish_handle, False)
-
     handle = 0
     # Wait until the record shows up in publish
     while handle == 0:
-        e = q.expect('dbus-signal', signal='MembersChangedDetailed',
-                path=publish)
-        # Versions of telepathy-glib prior to 0.14.6 incorrectly used the name
-        # 'member-ids'.
-        try:
-            ids = e.args[4]['contact-ids']
-        except KeyError:
-            ids = e.args[4]['member-ids']
-
-        for h in e.args[0]:
-            name = ids[h]
-            if name == contact_name:
+        e = q.expect('dbus-signal', signal='ContactsChangedWithID',
+                path=conn.object_path)
+        for h, state in e.args[0].items():
+            name = e.args[1][h]
+            if name == contact_name and state[1] == cs.SUBSCRIPTION_STATE_YES:
                 handle = h
 
     return handle



More information about the telepathy-commits mailing list