[telepathy-gabble/master] Add a test for the initial capabilities

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jul 28 14:59:18 PDT 2009


At the moment, we initially claim to support both non-Google Jingle
dialects (we always claim to support Google sessions) and all three
Jingle transports. However, these go away when streamed media capabilities
are explicitly removed...

For the moment, assume that the current behaviour is good, and assert it.
---
 tests/twisted/Makefile.am          |    1 +
 tests/twisted/caps/initial-caps.py |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 tests/twisted/caps/initial-caps.py

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 1cd1e16..4e8b9b0 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -6,6 +6,7 @@ TWISTED_TESTS = \
 	caps/caps-cache.py \
 	caps/from-bare-jid.py \
 	caps/hashed-caps.py \
+	caps/initial-caps.py \
 	caps/receive-jingle.py \
 	caps/tube-caps.py \
 	muc/name-conflict.py \
diff --git a/tests/twisted/caps/initial-caps.py b/tests/twisted/caps/initial-caps.py
new file mode 100644
index 0000000..83939b0
--- /dev/null
+++ b/tests/twisted/caps/initial-caps.py
@@ -0,0 +1,36 @@
+"""
+Test initial capabilities
+"""
+
+import dbus
+
+from twisted.words.xish import xpath, domish
+
+from servicetest import EventPattern
+from gabbletest import exec_test, sync_stream
+from caps_helper import check_caps, disco_caps
+import constants as cs
+import ns
+
+def run_test(q, bus, conn, stream):
+    conn.Connect()
+
+    _, initial_presence = q.expect_many(
+            EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+            EventPattern('stream-presence'),
+            )
+
+    _, namespaces = disco_caps(q, stream, initial_presence)
+
+    # For some reason, until we advertise any capabilities, these caps turn
+    # up in our presence
+    check_caps(namespaces, [
+        ns.JINGLE,
+        ns.JINGLE_015,
+        ns.JINGLE_TRANSPORT_ICEUDP,
+        ns.JINGLE_TRANSPORT_RAWUDP,
+        ns.GOOGLE_P2P
+        ])
+
+if __name__ == '__main__':
+    exec_test(run_test)
-- 
1.5.6.5



More information about the telepathy-commits mailing list