[Telepathy-commits] [telepathy-gabble/master] fix olpc-muc-invitation.py. return False doesn't make the test fail as with the old API
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Tue Aug 19 10:52:49 PDT 2008
20080529101914-7fe3f-ef54d2f0278085dcac2b1e38954743ce9aa65a41.gz
---
tests/twisted/olpc/olpc-muc-invitation.py | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/tests/twisted/olpc/olpc-muc-invitation.py b/tests/twisted/olpc/olpc-muc-invitation.py
index 838a10f..5754df6 100644
--- a/tests/twisted/olpc/olpc-muc-invitation.py
+++ b/tests/twisted/olpc/olpc-muc-invitation.py
@@ -60,8 +60,7 @@ def test(q, bus, conn, stream):
stream.send(message)
event = q.expect('dbus-signal', signal='NewChannel')
- if event.args[1] != 'org.freedesktop.Telepathy.Channel.Type.Text':
- return False
+ assert event.args[1] == 'org.freedesktop.Telepathy.Channel.Type.Text'
assert event.args[2] == 2 # handle type
assert event.args[3] == 1 # handle
@@ -146,10 +145,8 @@ def test(q, bus, conn, stream):
call_async(q, group_iface, 'AddMembers', [alice_handle],
'I want to test invitations')
- event = q.expect('stream-message')
+ event = q.expect('stream-message', to='alice at localhost')
message = event.stanza
- if message['to'] != 'alice at localhost':
- return False
properties = xpath.queryForNodes('/message/properties', message)
assert (properties is not None and len(properties) == 1), repr(properties)
@@ -173,10 +170,8 @@ def test(q, bus, conn, stream):
assert 'color' in seen, seen
assert 'private' in seen, seen
- event = q.expect('stream-message')
+ event = q.expect('stream-message', to='chat at conf.localhost')
message = event.stanza
- if message['to'] != 'chat at conf.localhost':
- return False
x = xpath.queryForNodes('/message/x', message)
assert (x is not None and len(x) == 1), repr(x)
@@ -193,10 +188,8 @@ def test(q, bus, conn, stream):
call_async(q, act_prop_iface, 'SetProperties',
room_handle, {'color': '#f00baa,#f00baa', 'private': True})
- event = q.expect('stream-message')
+ event = q.expect('stream-message', to='alice at localhost')
message = event.stanza
- if message['to'] != 'alice at localhost':
- return False
properties = xpath.queryForNodes('/message/properties', message)
assert (properties is not None and len(properties) == 1), repr(properties)
--
1.5.6.3
More information about the Telepathy-commits
mailing list