summaryrefslogtreecommitdiff
path: root/tests/twisted/roster
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-01 18:18:51 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-01 18:18:51 +0100
commitfa516d32ef319da9b9a26873ea66ed98ac4db102 (patch)
treeaa5b248d65fe362db2eb86f44d48e27ccd11ed19 /tests/twisted/roster
parenteffc4b88b23f3bba852e6d8262253bdcdf878b11 (diff)
roster/authorize.py: test acknowledging remote removal with RemoveContacts
Diffstat (limited to 'tests/twisted/roster')
-rw-r--r--tests/twisted/roster/authorize.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/twisted/roster/authorize.py b/tests/twisted/roster/authorize.py
index 1232fe3aa..ae057a199 100644
--- a/tests/twisted/roster/authorize.py
+++ b/tests/twisted/roster/authorize.py
@@ -12,7 +12,7 @@ import ns
from twisted.words.xish import domish
-def test(q, bus, conn, stream, modern=True):
+def test(q, bus, conn, stream, modern=True, remove=False):
call_async(q, conn.ContactList, 'GetContactListAttributes', [], False)
q.expect('dbus-error', method='GetContactListAttributes',
@@ -140,16 +140,19 @@ def test(q, bus, conn, stream, modern=True):
# The old Chan.T.ContactList API can't acknowledge RemovedRemotely,
# because it sees it as "not there at all" and the group logic drops
# the "redundant" request.
- #
- # FIXME: test RemoveContacts here too
- call_async(q, conn.ContactList, 'Unpublish', [arnold])
+ if remove:
+ returning_method = 'RemoveContacts'
+ call_async(q, conn.ContactList, 'RemoveContacts', [arnold])
+ else:
+ returning_method = 'Unpublish'
+ call_async(q, conn.ContactList, 'Unpublish', [arnold])
# Even if we Unpublish() here, Arnold was never on our XMPP roster,
# so setting his publish state to SUBSCRIPTION_STATE_NO should result
# in his removal.
q.expect_many(
- EventPattern('dbus-return', method='Unpublish'),
+ EventPattern('dbus-return', method=returning_method),
EventPattern('dbus-signal', signal='ContactsChanged',
args=[{}, [arnold]]),
)
@@ -160,6 +163,10 @@ def test_ancient(q, bus, conn, stream):
def test_modern(q, bus, conn, stream):
test(q, bus, conn, stream, modern=True)
+def test_modern_remove(q, bus, conn, stream):
+ test(q, bus, conn, stream, modern=True, remove=True)
+
if __name__ == '__main__':
exec_test(test_ancient)
exec_test(test_modern)
+ exec_test(test_modern_remove)