[Telepathy-commits] [telepathy-gabble/master] Amend #12791 regression test to test with what the submitter actually had on their roster, as well as with a garbled roster that the server shouldn't have sent us
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:51:52 PDT 2008
20080428165342-53eee-2f71e379a51013bdeeb90c5f6077a423f7926aa1.gz
---
tests/twisted/roster/groups-12791.py | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/tests/twisted/roster/groups-12791.py b/tests/twisted/roster/groups-12791.py
index 83b249c..bd4435a 100644
--- a/tests/twisted/roster/groups-12791.py
+++ b/tests/twisted/roster/groups-12791.py
@@ -1,6 +1,5 @@
-
"""
-Test basic roster functionality.
+Test broken groups on the roster (regression test for fd.o #12791)
"""
import dbus
@@ -51,21 +50,33 @@ def test(q, bus, conn, stream):
group = item.addElement('group', content='women')
group = item.addElement('group', content='affected-by-fdo-12791')
+ # This is a broken roster - Amy appears twice. This should only happen
+ # if the server is somehow buggy. This was my initial attempt at
+ # reproducing fd.o #12791 - I doubt it's very realistic, but we shouldn't
+ # assert, regardless of what input we get!
+ item = event.query.addElement('item')
+ item['jid'] = 'amy at foo.com'
+ item['subscription'] = 'both'
+ group = item.addElement('group', content='women')
+
item = event.query.addElement('item')
item['jid'] = 'bob at foo.com'
item['subscription'] = 'from'
group = item.addElement('group', content='men')
+ # This is what was *actually* strange about the #12791 submitter's roster -
+ # Bob appears, fully subscribed, but also there's an attempt to subscribe
+ # to one of Bob's resources. We now ignore such items
+ item = event.query.addElement('item')
+ item['jid'] = 'bob at foo.com/Resource'
+ item['subscription'] = 'none'
+ item['ask'] = 'subscribe'
+
item = event.query.addElement('item')
item['jid'] = 'che at foo.com'
item['subscription'] = 'to'
group = item.addElement('group', content='men')
- item = event.query.addElement('item')
- item['jid'] = 'amy at foo.com'
- item['subscription'] = 'both'
- group = item.addElement('group', content='women')
-
stream.send(event.stanza)
# FIXME: this is somewhat fragile - it's asserting the exact order that
--
1.5.6.3
More information about the Telepathy-commits
mailing list