telepathy-gabble: test-roster-item-deletion: stop testing old roster API
Guillaume Desmottes
gdesmott at kemper.freedesktop.org
Tue Oct 8 12:53:34 PDT 2013
Module: telepathy-gabble
Branch: master
Commit: dff1adaf39d6f44a4dcb64652e605ea239ea9875
URL: http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=dff1adaf39d6f44a4dcb64652e605ea239ea9875
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date: Tue Oct 8 14:47:49 2013 -0400
test-roster-item-deletion: stop testing old roster API
---
tests/twisted/roster/test-roster-item-deletion.py | 42 ++++-----------------
1 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/tests/twisted/roster/test-roster-item-deletion.py b/tests/twisted/roster/test-roster-item-deletion.py
index 7b2d091..10c6e04 100644
--- a/tests/twisted/roster/test-roster-item-deletion.py
+++ b/tests/twisted/roster/test-roster-item-deletion.py
@@ -3,25 +3,18 @@ Regression test for http://bugs.freedesktop.org/show_bug.cgi?id=19524
"""
from gabbletest import exec_test, acknowledge_iq
-from rostertest import (expect_contact_list_signals,
- check_contact_list_signals, send_roster_push)
-from servicetest import (assertLength, assertEquals, EventPattern, call_async)
+from rostertest import (send_roster_push, check_contact_roster)
+from servicetest import (assertEquals, EventPattern, call_async)
import constants as cs
import ns
-def test_ancient(q, bus, conn, stream):
- test(q, bus, conn, stream, False)
-
def test_modern(q, bus, conn, stream):
- test(q, bus, conn, stream, True)
-
-def test_ancient_queued(q, bus, conn, stream):
- test(q, bus, conn, stream, False, True)
+ test(q, bus, conn, stream)
def test_modern_queued(q, bus, conn, stream):
- test(q, bus, conn, stream, True, True)
+ test(q, bus, conn, stream, True)
-def test(q, bus, conn, stream, modern=True, queued=False):
+def test(q, bus, conn, stream, queued=False):
event = q.expect('stream-iq', query_ns=ns.ROSTER)
event.stanza['type'] = 'result'
@@ -40,17 +33,7 @@ def test(q, bus, conn, stream, modern=True, queued=False):
args=[{quux_handle:
(cs.SUBSCRIPTION_STATE_NO, cs.SUBSCRIPTION_STATE_NO, '')}, []])
- pairs = expect_contact_list_signals(q, bus, conn,
- ['publish', 'subscribe', 'stored'])
-
- check_contact_list_signals(q, bus, conn, pairs.pop(0), cs.HT_LIST,
- 'publish', [])
- check_contact_list_signals(q, bus, conn, pairs.pop(0), cs.HT_LIST,
- 'subscribe', [])
- stored = check_contact_list_signals(q, bus, conn, pairs.pop(0), cs.HT_LIST,
- 'stored', ['quux at foo.com'])
-
- assertLength(0, pairs) # i.e. we've checked all of them
+ check_contact_roster(conn, 'quux at foo.com', [], cs.SUBSCRIPTION_STATE_NO, cs.SUBSCRIPTION_STATE_NO)
if queued:
conn.Aliasing.SetAliases({quux_handle: 'Quux'})
@@ -64,10 +47,7 @@ def test(q, bus, conn, stream, modern=True, queued=False):
iq_type='set', query_ns=ns.ROSTER),
]
- if modern:
- call_async(q, conn.ContactList, 'RemoveContacts', [quux_handle])
- else:
- call_async(q, stored.Group, 'RemoveMembers', [quux_handle], '')
+ call_async(q, conn.ContactList, 'RemoveContacts', [quux_handle])
if queued:
# finish off the previous thing we were doing, so removal can proceed
@@ -81,9 +61,6 @@ def test(q, bus, conn, stream, modern=True, queued=False):
send_roster_push(stream, 'quux at foo.com', 'remove')
q.expect_many(
- EventPattern('dbus-signal', interface=cs.CHANNEL_IFACE_GROUP,
- path=stored.object_path, signal='MembersChanged',
- args=['', [], [quux_handle], [], [], 0, 0]),
EventPattern('dbus-signal', interface=cs.CONN_IFACE_CONTACT_LIST,
path=conn.object_path, signal='ContactsChanged',
args=[{}, [quux_handle]]),
@@ -92,13 +69,10 @@ def test(q, bus, conn, stream, modern=True, queued=False):
acknowledge_iq(stream, event.stanza)
- if modern:
- q.expect('dbus-return', method='RemoveContacts')
+ q.expect('dbus-return', method='RemoveContacts')
# FIXME: when we depend on a new enough tp-glib, RemoveMembers should
# return at this point too
if __name__ == '__main__':
- exec_test(test_ancient)
exec_test(test_modern)
- exec_test(test_ancient_queued)
exec_test(test_modern_queued)
More information about the telepathy-commits
mailing list