[Telepathy-commits] [telepathy-gabble/master] olpc-activity-search.py: test gadget activity properties change messages

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


20080627141031-7fe3f-0edba7e3a4036404e685b127e79a472976cc5f81.gz
---
 tests/twisted/olpc/olpc-activity-search.py |   33 ++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/olpc/olpc-activity-search.py b/tests/twisted/olpc/olpc-activity-search.py
index f41294b..020b2fc 100644
--- a/tests/twisted/olpc/olpc-activity-search.py
+++ b/tests/twisted/olpc/olpc-activity-search.py
@@ -309,6 +309,39 @@ def test(q, bus, conn, stream):
     assert sorted(conn.InspectHandles(2, [handle])) == \
             ['room4 at conference.localhost']
 
+    # Gadget informs us about an activity properties change
+    message = domish.Element(('jabber:client', 'message'))
+    message['from'] = 'gadget.localhost'
+    message['to'] = 'alice at localhost'
+    message['type'] = 'notice'
+
+    change = message.addElement((NS_OLPC_ACTIVITY, 'change'))
+    change['activity'] = 'testactivity'
+    change['room'] = 'testactivity at conference.localhost'
+    change['id'] = '0'
+    properties = change.addElement((NS_OLPC_ACTIVITY_PROPS, 'properties'))
+    property = properties.addElement((None, 'property'))
+    property['type'] = 'str'
+    property['name'] = 'tags'
+    property.addContent('game')
+    property = properties.addElement((None, "property"))
+    property['type'] = 'str'
+    property['name'] = 'color'
+    property.addContent('#AABBAA,#BBAABB')
+
+    amp = message.addElement((NS_AMP, 'amp'))
+    rule = amp.addElement((None, 'rule'))
+    rule['condition'] = 'deliver-at'
+    rule['value'] = 'stored'
+    rule['action'] ='error'
+    stream.send(message)
+
+    event = q.expect('dbus-signal', signal='ActivityPropertiesChanged')
+    room = event.args[0]
+    properties = event.args[1]
+
+    assert properties == {'tags': 'game', 'color': '#AABBAA,#BBAABB'}
+
     # remove one activity from view 0
     message = domish.Element((None, 'message'))
     message['from'] = 'gadget.localhost'
-- 
1.5.6.5




More information about the Telepathy-commits mailing list