[Telepathy-commits] [telepathy-gabble/master] olpc/util.py: check request structure in answer_to_current_act_pubsub_request

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:32 PDT 2008


20080703131835-7fe3f-5a254faa3a716551b27ba1c7d0a2869f701b7ab9.gz
---
 tests/twisted/olpc/util.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/olpc/util.py b/tests/twisted/olpc/util.py
index f84ac9a..f456439 100644
--- a/tests/twisted/olpc/util.py
+++ b/tests/twisted/olpc/util.py
@@ -112,7 +112,12 @@ def send_buddy_changed_current_act_msg(stream, from_, id, room):
     stream.send(message)
 
 def answer_to_current_act_pubsub_request(stream, request, id, room):
-    # TODO: check request structure
+    # check request structure
+    assert request['type'] == 'get'
+    items = xpath.queryForNodes(
+        '/iq/pubsub[@xmlns="%s"]/items' % NS_PUBSUB, request)[0]
+    assert items['node'] == NS_OLPC_CURRENT_ACTIVITY
+
     reply = make_result_iq(stream, request)
     reply['from'] = request['to']
     pubsub = reply.firstChildElement()
-- 
1.5.6.5




More information about the Telepathy-commits mailing list