[telepathy-mission-control/master] Capabilities tests: list StreamTube filters with a specific handle type

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jul 28 05:53:54 PDT 2009


This is currently what's necessary to make Gabble advertise the
capability, so it's more useful to behave like this when checking for
regressions.
---
 test/twisted/capabilities/draft-1.py          |   23 +++++++++++++++++++----
 test/twisted/capabilities/legacy-caps.py      |   10 +++++++++-
 test/twisted/telepathy/clients/AbiWord.client |    6 ++++++
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/test/twisted/capabilities/draft-1.py b/test/twisted/capabilities/draft-1.py
index ad41e30..4924e74 100644
--- a/test/twisted/capabilities/draft-1.py
+++ b/test/twisted/capabilities/draft-1.py
@@ -37,8 +37,14 @@ def test(q, bus, mc):
     # is activatable.
 
     # this must match the .client file
-    abi_fixed_properties = dbus.Dictionary({
+    abi_contact_fixed_properties = dbus.Dictionary({
         cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE,
+        cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT,
+        cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'x-abiword',
+        }, signature='sv')
+    abi_room_fixed_properties = dbus.Dictionary({
+        cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE,
+        cs.CHANNEL + '.TargetHandleType': cs.HT_ROOM,
         cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'x-abiword',
         }, signature='sv')
 
@@ -64,7 +70,15 @@ def test(q, bus, mc):
 
         assert (cs.CHANNEL_TYPE_STREAMED_MEDIA, 2L**32-1) in add
         assert (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1) in add
-        assert len(add) == 2
+
+        # MC puts StreamTube in the list twice - arguably a bug, but
+        # CMs should cope. So, don't assert about the length of the list
+        for item in add:
+            assert item in (
+                    (cs.CHANNEL_TYPE_STREAMED_MEDIA, 2L**32-1),
+                    (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1),
+                    )
+
         assert len(remove) == 0
 
         had.append('legacy')
@@ -74,8 +88,9 @@ def test(q, bus, mc):
         aasv = e.args[0]
 
         assert media_fixed_properties in aasv
-        assert abi_fixed_properties in aasv
-        assert len(aasv) == 2
+        assert abi_room_fixed_properties in aasv
+        assert abi_contact_fixed_properties in aasv
+        assert len(aasv) == 3
 
         had.append('draft-1')
         return True
diff --git a/test/twisted/capabilities/legacy-caps.py b/test/twisted/capabilities/legacy-caps.py
index 6e5a7b0..aad9c80 100644
--- a/test/twisted/capabilities/legacy-caps.py
+++ b/test/twisted/capabilities/legacy-caps.py
@@ -60,7 +60,15 @@ def test(q, bus, mc):
 
         assert (cs.CHANNEL_TYPE_STREAMED_MEDIA, 2L**32-1) in add
         assert (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1) in add
-        assert len(add) == 2
+
+        # MC puts StreamTube in the list twice - arguably a bug, but
+        # CMs should cope. So, don't assert about the length of the list
+        for item in add:
+            assert item in (
+                    (cs.CHANNEL_TYPE_STREAMED_MEDIA, 2L**32-1),
+                    (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1),
+                    )
+
         assert len(remove) == 0
 
         return True
diff --git a/test/twisted/telepathy/clients/AbiWord.client b/test/twisted/telepathy/clients/AbiWord.client
index aa3ee16..4022f43 100644
--- a/test/twisted/telepathy/clients/AbiWord.client
+++ b/test/twisted/telepathy/clients/AbiWord.client
@@ -3,4 +3,10 @@ Interfaces=org.freedesktop.Telepathy.Client.Handler
 
 [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
 org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube
+org.freedesktop.Telepathy.Channel.TargetHandleType u=1
+org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=x-abiword
+
+[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1]
+org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube
+org.freedesktop.Telepathy.Channel.TargetHandleType u=2
 org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=x-abiword
-- 
1.5.6.5



More information about the telepathy-commits mailing list