diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-01-13 19:14:31 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-02-22 12:23:48 +0000 |
commit | 68cc9321da656841204c975b91ae4ab007c282fc (patch) | |
tree | 09afad3539d31c458ca5ffeba2a3c1f6545613ac /tests/twisted/gateways.py | |
parent | bee1d8797ebce01876884b8d0807b230c8a4f8ba (diff) |
gateways test: carry out subscription exchange
Diffstat (limited to 'tests/twisted/gateways.py')
-rw-r--r-- | tests/twisted/gateways.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/twisted/gateways.py b/tests/twisted/gateways.py index bce152e41..a8b8b6bef 100644 --- a/tests/twisted/gateways.py +++ b/tests/twisted/gateways.py @@ -8,7 +8,10 @@ from twisted.words.xish import domish, xpath from servicetest import ( sync_dbus, call_async, EventPattern, assertEquals, assertContains, ) -from gabbletest import exec_test, send_error_reply, acknowledge_iq, sync_stream +from gabbletest import ( + exec_test, send_error_reply, acknowledge_iq, sync_stream, + make_presence, + ) import constants as cs import ns from config import PLUGINS_ENABLED @@ -27,7 +30,12 @@ def test_success(q, gateways_iface, stream): assertEquals('1970', xpath.queryForString('/query/username', e.query)) assertEquals('s3kr1t', xpath.queryForString('/query/password', e.query)) acknowledge_iq(stream, e.stanza) - q.expect('dbus-return', method='Register') + q.expect_many( + EventPattern('dbus-return', method='Register'), + EventPattern('stream-presence', presence_type='subscribe', + to='talkd.example.com'), + ) + stream.send(make_presence('talkd.example.com', type='subscribed')) def test_conflict(q, gateways_iface, stream): call_async(q, gateways_iface, 'Register', |