[telepathy-gabble/master] Add basic testing for the Senders property

Sjoerd Simons sjoerd.simons at collabora.co.uk
Tue Dec 29 05:35:22 PST 2009


---
 tests/twisted/constants.py          |    4 ++++
 tests/twisted/jingle/call-basics.py |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index a7dd405..e961236 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -85,6 +85,10 @@ CALL_DISPOSITION_NONE = 0
 CALL_DISPOSITION_EARLY_MEDIA = 1
 CALL_DISPOSITION_INITIAL = 2
 
+CALL_SENDING_STATE_NONE = 0
+CALL_SENDING_STATE_PENDING_SEND = 1
+CALL_SENDING_STATE_SENDING = 2
+
 CONN = "org.freedesktop.Telepathy.Connection"
 CONN_IFACE_AVATARS = CONN + '.Interface.Avatars'
 CONN_IFACE_CAPS = CONN + '.Interface.Capabilities'
diff --git a/tests/twisted/jingle/call-basics.py b/tests/twisted/jingle/call-basics.py
index 17920be..eb7fc03 100644
--- a/tests/twisted/jingle/call-basics.py
+++ b/tests/twisted/jingle/call-basics.py
@@ -150,6 +150,24 @@ def run_test(jp, q, bus, conn, stream, incoming):
 
     cstream = bus.get_object (conn.bus_name, content_properties["Streams"][0])
 
+    stream_props = cstream.GetAll (cs.CALL_STREAM,
+        dbus_interface = dbus.PROPERTIES_IFACE)
+
+    assertContains (self_handle, stream_props["Senders"].keys())
+    assertContains (remote_handle, stream_props["Senders"].keys())
+
+    if incoming:
+        assertEquals (cs.CALL_SENDING_STATE_PENDING_SEND,
+            stream_props["Senders"][self_handle])
+        assertEquals (cs.CALL_SENDING_STATE_SENDING,
+            stream_props["Senders"][remote_handle])
+    else:
+        assertEquals (cs.CALL_SENDING_STATE_PENDING_SEND,
+            stream_props["Senders"][remote_handle])
+        assertEquals (cs.CALL_SENDING_STATE_SENDING,
+            stream_props["Senders"][self_handle])
+
+
     # Media type should audio
     assertEquals (cs.CALL_MEDIA_TYPE_AUDIO, content_properties["Type"])
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list