[Telepathy-commits] [telepathy-gabble/master] olpc-buddy-search.py: check if the NewChannels and NewChannel signal are properly raised

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Oct 14 03:24:00 PDT 2008


---
 tests/twisted/olpc/olpc-buddy-search.py |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index 1b89135..21c3396 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -118,10 +118,12 @@ def test(q, bus, conn, stream):
           olpc_name_prefix + '.Channel.Interface.View.MaxSize': 3
           })
 
-    iq_event, return_event = q.expect_many(
+    iq_event, return_event, new_channels_event, new_channel_event = q.expect_many(
         EventPattern('stream-iq', to='gadget.localhost',
             query_ns=NS_OLPC_BUDDY),
-        EventPattern('dbus-return', method='CreateChannel'))
+        EventPattern('dbus-return', method='CreateChannel'),
+        EventPattern('dbus-signal', signal='NewChannels'),
+        EventPattern('dbus-signal', signal='NewChannel'))
 
     view = iq_event.stanza.firstChildElement()
     assert view.name == 'view'
@@ -149,6 +151,17 @@ def test(q, bus, conn, stream):
     props = return_event.value[1]
     view1 = bus.get_object(conn.bus_name, view_path)
 
+    # check NewChannels arg
+    channels = new_channels_event.args[0]
+    assert len(channels) == 1
+    chan, props_ = channels[0]
+    assert chan == view_path
+    assert props == props_
+
+    # check NewChannel arg
+    chan = new_channel_event.args[0]
+    assert chan == view_path
+
     assert props['org.laptop.Telepathy.Channel.Type.BuddyView.Properties'] == {}
     assert props['org.laptop.Telepathy.Channel.Type.BuddyView.Alias'] == ''
 
-- 
1.5.6.5



More information about the Telepathy-commits mailing list