[telepathy-gabble/master] Test the CallMembers property a bit

Sjoerd Simons sjoerd.simons at collabora.co.uk
Mon Dec 14 10:23:19 PST 2009


---
 tests/twisted/constants.py          |    3 +++
 tests/twisted/jingle/call-basics.py |   17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index e961236..bf8f324 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -81,6 +81,9 @@ CALL_STATE_PENDING_RECEIVER = 2
 CALL_STATE_ACCEPTED = 3
 CALL_STATE_ENDED = 4
 
+CALL_MEMBER_FLAG_RINGING = 1
+CALL_MEMBER_FLAG_HELD = 2
+
 CALL_DISPOSITION_NONE = 0
 CALL_DISPOSITION_EARLY_MEDIA = 1
 CALL_DISPOSITION_INITIAL = 2
diff --git a/tests/twisted/jingle/call-basics.py b/tests/twisted/jingle/call-basics.py
index bd2fe82..2742914 100644
--- a/tests/twisted/jingle/call-basics.py
+++ b/tests/twisted/jingle/call-basics.py
@@ -15,6 +15,7 @@ from servicetest import (
     )
 import constants as cs
 from jingletest2 import JingleTest2, test_all_dialects
+import ns
 
 def check_state (q, chan, state, wait = False):
     if wait:
@@ -120,11 +121,15 @@ def run_test(jp, q, bus, conn, stream, incoming):
         dbus_interface=dbus.PROPERTIES_IFACE)
 
     # Check if all the properties are there
-    assertEquals (sorted([ "Contents",
+    assertEquals (sorted([ "Contents", "CallMembers",
         "CallState", "CallFlags", "CallStateReason", "CallStateDetails",
         "HardwareStreaming", "InitialAudio", "InitialVideo",
         "MutableContents" ]), sorted(properties.keys()))
 
+    # Remote member is the target
+    assertEquals ([remote_handle], properties["CallMembers"].keys())
+    assertEquals (0, properties["CallMembers"][remote_handle])
+
     # No Hardware Streaming for you
     assertEquals (False, properties["HardwareStreaming"])
 
@@ -256,6 +261,16 @@ def run_test(jp, q, bus, conn, stream, incoming):
 
         jt2.parse_session_initiate(session_initiate.query)
 
+        if jp.is_modern_jingle():
+            # The other person's client starts ringing, and tells us so!
+            node = jp.SetIq(jt2.peer, jt2.jid, [
+                jp.Jingle(jt2.sid, jt2.jid, 'session-info', [
+                    ('ringing', ns.JINGLE_RTP_INFO_1, {}, []) ]) ])
+            stream.send(jp.xml(node))
+
+            q.expect ('dbus-signal', signal="CallMembersChanged",
+                args = [{ remote_handle: cs.CALL_MEMBER_FLAG_RINGING }, []])
+
         jt2.accept()
 
         o = q.expect ('dbus-signal', signal='NewCodecOffer')
-- 
1.5.6.5




More information about the telepathy-commits mailing list