From 98a2d8a5f7e96358b45150e3fa0e2a879973d84a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 23 Sep 2013 14:02:25 +0100 Subject: [PATCH 08/16] Use inspect_contacts_sync instead of InspectHandles --- tests/twisted/roster/initial-roster.py | 12 +++++------- tests/twisted/roster/publish.py | 6 +++--- tests/twisted/roster/subscribe.py | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/twisted/roster/initial-roster.py b/tests/twisted/roster/initial-roster.py index f745bb6..f68c4cf 100644 --- a/tests/twisted/roster/initial-roster.py +++ b/tests/twisted/roster/initial-roster.py @@ -54,7 +54,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') stored = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, stored.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(stored.Group.GetMembers())) assertEquals(set(['amy@foo.com', 'bob@foo.com', 'chris@foo.com']), jids) call_async(q, conn.Requests, 'EnsureChannel',{ @@ -65,7 +65,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') subscribe = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, subscribe.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(subscribe.Group.GetMembers())) # everyone on our roster is (falsely!) alleged to be on 'subscribe' # (in fact this ought to be just Amy and Chris, but libpurple apparently # can't represent this) @@ -79,7 +79,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') publish = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, publish.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(publish.Group.GetMembers())) # the publish list is somewhat imaginary because libpurple doesn't have # state-recovery assertEquals(set(), jids) @@ -92,8 +92,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') group_chan = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, - group_chan.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(group_chan.Group.GetMembers())) assertEquals(set(['amy@foo.com', 'bob@foo.com']), jids) # the XMPP prpl puts people into some sort of group, probably called @@ -120,8 +119,7 @@ def test(q, bus, conn, stream): cs.CHANNEL_TYPE_CONTACT_LIST) default_props = props - jids = set(conn.InspectHandles(cs.HT_CONTACT, - default_group.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(default_group.Group.GetMembers())) assertEquals(set(['chris@foo.com']), jids) call_async(q, conn.Requests, 'EnsureChannel',{ diff --git a/tests/twisted/roster/publish.py b/tests/twisted/roster/publish.py index 791f097..3b92c30 100644 --- a/tests/twisted/roster/publish.py +++ b/tests/twisted/roster/publish.py @@ -26,7 +26,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') publish = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, publish.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(publish.Group.GetMembers())) assertEquals(set(), jids) call_async(q, conn.Requests, 'EnsureChannel',{ @@ -37,7 +37,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') stored = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, stored.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(stored.Group.GetMembers())) assertEquals(set(), jids) call_async(q, conn.Requests, 'EnsureChannel',{ @@ -48,7 +48,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') subscribe = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, subscribe.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(subscribe.Group.GetMembers())) assertEquals(set(), jids) # receive a subscription request diff --git a/tests/twisted/roster/subscribe.py b/tests/twisted/roster/subscribe.py index b1b9aa5..28f4107 100644 --- a/tests/twisted/roster/subscribe.py +++ b/tests/twisted/roster/subscribe.py @@ -27,7 +27,7 @@ def test(q, bus, conn, stream): e = q.expect('dbus-return', method='EnsureChannel') subscribe = wrap_channel(bus.get_object(conn.bus_name, e.value[1]), cs.CHANNEL_TYPE_CONTACT_LIST) - jids = set(conn.InspectHandles(cs.HT_CONTACT, subscribe.Group.GetMembers())) + jids = set(conn.inspect_contacts_sync(subscribe.Group.GetMembers())) assertEquals(set(), jids) assertLength(0, subscribe.Group.GetMembers()) -- 1.8.4.rc3