[Telepathy-commits] [telepathy-gabble/master] test-si-tubes.py: Better code for: Check that tube offers contains @to with the resource

Alban Crequy alban.crequy at collabora.co.uk
Wed Nov 12 07:41:30 PST 2008


---
 tests/twisted/tubes/test-si-tubes.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/tubes/test-si-tubes.py b/tests/twisted/tubes/test-si-tubes.py
index 25ed9eb..ace124b 100644
--- a/tests/twisted/tubes/test-si-tubes.py
+++ b/tests/twisted/tubes/test-si-tubes.py
@@ -367,8 +367,7 @@ def test(q, bus, conn, stream):
 
     event = q.expect('stream-message')
     message = event.stanza
-    offer_nodes = xpath.queryForNodes('/message', message)
-    assert offer_nodes[0]['to'] == 'bob at localhost/Bob' # check the resource
+    assert message['to'] == 'bob at localhost/Bob' # check the resource
     tube_nodes = xpath.queryForNodes('/message/tube[@xmlns="%s"]' % NS_TUBES,
         message)
     assert tube_nodes is not None
@@ -451,8 +450,7 @@ def test(q, bus, conn, stream):
 
     event = q.expect('stream-message')
     message = event.stanza
-    offer_nodes = xpath.queryForNodes('/message', message)
-    assert offer_nodes[0]['to'] == 'bob at localhost/Bob' # check the resource
+    assert message['to'] == 'bob at localhost/Bob' # check the resource
     tube_nodes = xpath.queryForNodes('/message/tube[@xmlns="%s"]' % NS_TUBES,
         message)
     assert tube_nodes is not None
-- 
1.5.6.5



More information about the Telepathy-commits mailing list