summaryrefslogtreecommitdiff
path: root/tests/twisted
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-08-02 12:00:20 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-08-03 16:11:20 +0100
commit4a1c3ac01f12b71a7805524c1e6cb40c49a8d7e6 (patch)
tree692fb6df3b78c1e1499d061b6984c45cc07e398d /tests/twisted
parent65ce06e7b8f9993a8412d5949f67313f323d3901 (diff)
GabbleRoster: don't do lots of work to aggregate contacts' group changes
There's now no point: the only time we'll get multiple contacts' group changes is in the initial roster download, at which point TpBaseContactList will be ignoring the change notification anyway (it recovers state in tp_base_contact_list_set_list_received). Instead, aggregate changes to multiple groups for a single contact into one signal, which is what really happens in XMPP anyway. This is an observable change in roster/groups.py, fixing a FIXME comment.
Diffstat (limited to 'tests/twisted')
-rw-r--r--tests/twisted/roster/groups.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/twisted/roster/groups.py b/tests/twisted/roster/groups.py
index 48603245f..d43dcfcae 100644
--- a/tests/twisted/roster/groups.py
+++ b/tests/twisted/roster/groups.py
@@ -101,16 +101,11 @@ def test(q, bus, conn, stream):
item.addElement('group', content='ladies')
stream.send(iq)
- # FIXME: ideally, this would emit a single GroupsChanged, but as a relic
- # of the Chan.T.ContactList code, it splits up updates by group
- q.expect_many(
- EventPattern('dbus-signal', signal='GroupsChanged',
- args=[[amy], [], ['women']]),
- EventPattern('dbus-signal', signal='GroupsChanged',
- args=[[amy], ['people starting with A'], []]),
- EventPattern('dbus-signal', signal='GroupsChanged',
- args=[[amy], ['ladies'], []]),
- )
+ # We get a single signal corresponding to that roster push
+ e = q.expect('dbus-signal', signal='GroupsChanged',
+ predicate=lambda e: e.args[0] == [amy])
+ assertEquals(set(['ladies', 'people starting with A']), set(e.args[1]))
+ assertEquals(['women'], e.args[2])
# check that Amy's state is what we expected
attrs = conn.Contacts.GetContactAttributes([amy],