diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-09-02 14:29:48 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-09-02 14:29:48 +0100 |
commit | 94654d7f3557d4416d343696b7622baa6ed54757 (patch) | |
tree | bc5299dc2c18e039086ab2044e4b4d8754df139c /tests | |
parent | 4a2ea8b9262fda3099dee114a1c3f0f2ba9348d1 (diff) |
test-roster-subscribe: assert that we don't send useless subscribe requests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/roster/test-roster-subscribe.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/twisted/roster/test-roster-subscribe.py b/tests/twisted/roster/test-roster-subscribe.py index 2a0c205c8..d389f6e18 100644 --- a/tests/twisted/roster/test-roster-subscribe.py +++ b/tests/twisted/roster/test-roster-subscribe.py @@ -88,6 +88,23 @@ def test(q, bus, conn, stream, modern=True): }, []]), ) + send_roster_push(stream, 'bob@foo.com', 'to') + q.expect('stream-iq', iq_type='result', iq_id='push') + + # Doing the same again is a successful no-op + forbidden = [EventPattern('stream-iq', query_ns=ns.ROSTER), + EventPattern('stream-presence')] + sync_stream(q, stream) + sync_dbus(bus, q, conn) + q.forbid_events(forbidden) + + call_async(q, conn.ContactList, 'RequestSubscription', [bob], 'moo') + q.expect('dbus-return', method='RequestSubscription') + + sync_stream(q, stream) + sync_dbus(bus, q, conn) + q.unforbid_events(forbidden) + if __name__ == '__main__': exec_test(test_ancient) exec_test(test_modern) |