[Telepathy-commits] [telepathy-gabble/master] olpc-buddy-search: check D-Bus properties

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Oct 8 09:05:03 PDT 2008


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

diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index 72f87bb..03e4c5c 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -143,8 +143,31 @@ def test(q, bus, conn, stream):
     view_path = return_event.value[0]
     view1 = bus.get_object(conn.bus_name, view_path)
 
-    # TODO: check the values of most the D-Bus properties (including
-    # Interfaces)
+    # check org.freedesktop.Telepathy.Channel D-Bus properties
+    props = view1.GetAll(
+        'org.freedesktop.Telepathy.Channel',
+        dbus_interface='org.freedesktop.DBus.Properties')
+
+    assert props['ChannelType'] == 'org.laptop.Telepathy.Channel.Type.BuddyView'
+    assert 'org.laptop.Telepathy.Channel.Interface.View' in props['Interfaces']
+    assert props['TargetHandle'] == 0
+    assert props['TargetID'] == ''
+    assert props['TargetHandleType'] == 0
+
+    # check org.laptop.Telepathy.Channel.Interface.View D-Bus properties
+    props = view1.GetAll(
+        'org.laptop.Telepathy.Channel.Interface.View',
+        dbus_interface='org.freedesktop.DBus.Properties')
+
+    assert props['MaxSize'] == 3
+
+    # check org.laptop.Telepathy.Channel.Type.BuddyView D-Bus properties
+    props = view1.GetAll(
+        'org.laptop.Telepathy.Channel.Type.BuddyView',
+        dbus_interface='org.freedesktop.DBus.Properties')
+
+    assert props['Properties'] == {}
+    assert props['Alias'] == ''
 
     event = q.expect('dbus-signal', signal='BuddiesChanged')
     added, removed = event.args
@@ -217,6 +240,14 @@ def test(q, bus, conn, stream):
     view_path = return_event.value[0]
     view2 = bus.get_object(conn.bus_name, view_path)
 
+    # check org.laptop.Telepathy.Channel.Type.BuddyView D-Bus properties
+    props = view2.GetAll(
+        'org.laptop.Telepathy.Channel.Type.BuddyView',
+        dbus_interface='org.freedesktop.DBus.Properties')
+
+    assert props['Properties'] == {'color': '#AABBCC,#001122'}
+    assert props['Alias'] == ''
+
     event = q.expect('dbus-signal', signal='BuddiesChanged')
     added, removed = event.args
     assert removed == []
@@ -315,6 +346,14 @@ def test(q, bus, conn, stream):
     view_path = return_event.value[0]
     view3 = bus.get_object(conn.bus_name, view_path)
 
+    # check org.laptop.Telepathy.Channel.Type.BuddyView D-Bus properties
+    props = view3.GetAll(
+        'org.laptop.Telepathy.Channel.Type.BuddyView',
+        dbus_interface='org.freedesktop.DBus.Properties')
+
+    assert props['Properties'] == {}
+    assert props['Alias'] == 'tom'
+
     event = q.expect('dbus-signal', signal='BuddiesChanged')
     added, removed = event.args
     assert removed == []
-- 
1.5.6.5




More information about the Telepathy-commits mailing list