[Telepathy-commits] [telepathy-gabble/master] roster/ tests: use presence_type= to expect only those presence messages
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:34 PDT 2008
20080722165602-53eee-d390ff7bc107aa2be000da921b06809b9445484c.gz
---
tests/twisted/roster/test-google-roster.py | 5 +----
tests/twisted/roster/test-roster-subscribe.py | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/tests/twisted/roster/test-google-roster.py b/tests/twisted/roster/test-google-roster.py
index d36aff2..b77415e 100644
--- a/tests/twisted/roster/test-google-roster.py
+++ b/tests/twisted/roster/test-google-roster.py
@@ -63,10 +63,7 @@ def test(q, bus, conn, stream):
item["jid"], "none", False)
stream.send(iq)
- while 1:
- event = q.expect('stream-presence')
- if event.stanza['type'] == 'subscribe':
- break
+ event = q.expect('stream-presence', presence_type='subscribe')
# send pending roster item
iq = make_set_roster_iq(stream, 'test at localhost/Resource', event.to,
diff --git a/tests/twisted/roster/test-roster-subscribe.py b/tests/twisted/roster/test-roster-subscribe.py
index 7a61a6c..cdba4e7 100644
--- a/tests/twisted/roster/test-roster-subscribe.py
+++ b/tests/twisted/roster/test-roster-subscribe.py
@@ -44,10 +44,7 @@ def test(q, bus, conn, stream):
acknowledge_iq(stream, event.stanza)
- while 1:
- event = q.expect('stream-presence')
- if event.stanza['type'] == 'subscribe':
- break
+ event = q.expect('stream-presence', presence_type='subscribe')
presence = domish.Element(('jabber:client', 'presence'))
presence['from'] = 'bob at foo.com'
--
1.5.6.3
More information about the Telepathy-commits
mailing list