diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.com> | 2011-11-02 13:20:15 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-11-15 15:30:22 +0000 |
commit | 31c2cd55912c72c82cba28202f220a80c8b4faca (patch) | |
tree | 7e9f9a04a7f8cd000409aeb06b516d73f53ca0d1 | |
parent | 284779859a67e2dfceb4d9930df81e452d5a4b3a (diff) |
expect MembersChanged AND ContactsChanged on sub-request
We should explicitly expect the relevant state transition on the publish
channel; and when forbidding events, we just forbid them from occurring
on the publish channel.
(fix by Will Thompson, thanks Will)
-rw-r--r-- | tests/twisted/roster/test-google-roster.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/twisted/roster/test-google-roster.py b/tests/twisted/roster/test-google-roster.py index 3b8d8f6c3..b419cd9e8 100644 --- a/tests/twisted/roster/test-google-roster.py +++ b/tests/twisted/roster/test-google-roster.py @@ -282,13 +282,19 @@ def test_local_pending(q, bus, conn, stream, subscribe): presence['type'] = 'subscribe' stream.send(presence) - q.expect('dbus-signal', signal='ContactsChanged', + q.expect_many( + EventPattern('dbus-signal', signal='MembersChanged', + args=['', [], [], [handle], [], handle, cs.GC_REASON_NONE], + predicate=is_publish), + EventPattern('dbus-signal', signal='ContactsChanged', args=[{handle: (cs.SUBSCRIPTION_STATE_NO, - cs.SUBSCRIPTION_STATE_ASK, '')}, []]) + cs.SUBSCRIPTION_STATE_ASK, '')}, []]), + ) # Now we send the spurious roster update with subscribe="none" and verify - # that nothing happens in reaction to that - change_event = EventPattern('dbus-signal', signal='MembersChanged') + # that nothing happens to her publish state in reaction to that + change_event = EventPattern('dbus-signal', signal='MembersChanged', + predicate=is_publish) q.forbid_events([change_event]) iq = make_set_roster_iq(stream, 'test@localhost/Resource', contact, |