[telepathy-gabble/master] Test Name, Creator and Disposition properties
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 | 22 ++++++++++++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 8623013..a7dd405 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -81,6 +81,10 @@ CALL_STATE_PENDING_RECEIVER = 2
CALL_STATE_ACCEPTED = 3
CALL_STATE_ENDED = 4
+CALL_DISPOSITION_NONE = 0
+CALL_DISPOSITION_EARLY_MEDIA = 1
+CALL_DISPOSITION_INITIAL = 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 c1db1db..17920be 100644
--- a/tests/twisted/jingle/call-basics.py
+++ b/tests/twisted/jingle/call-basics.py
@@ -3,6 +3,8 @@ Test basic outgoing and incoming call handling
"""
import dbus
+from dbus.exceptions import DBusException
+
from twisted.words.xish import xpath
from gabbletest import exec_test
@@ -136,6 +138,15 @@ def run_test(jp, q, bus, conn, stream, incoming):
# Has one stream
assertLength (1, content_properties["Streams"])
+ assertEquals (cs.CALL_DISPOSITION_INITIAL,
+ content_properties["Disposition"])
+
+ if incoming:
+ assertEquals (remote_handle, content_properties["Creator"])
+ else:
+ assertEquals (self_handle, content_properties["Creator"])
+
+ assertContains ("Name", content_properties.keys())
cstream = bus.get_object (conn.bus_name, content_properties["Streams"][0])
@@ -240,9 +251,16 @@ def run_test(jp, q, bus, conn, stream, incoming):
check_state (q, chan, cs.CALL_STATE_ACCEPTED)
try:
- path = chan.AddContent ("Video", cs.CALL_MEDIA_TYPE_AUDIO,
+ path = chan.AddContent ("Webcam", cs.CALL_MEDIA_TYPE_AUDIO,
dbus_interface=cs.CHANNEL_TYPE_CALL)
- except Exception, e:
+ content = bus.get_object (conn.bus_name, path)
+ content_properties = content.GetAll (cs.CALL_CONTENT,
+ dbus_interface=dbus.PROPERTIES_IFACE)
+
+ assertEquals (0, content_properties["Disposition"])
+ assertEquals (self_handle, content_properties["Creator"])
+ assertContains ("Webcam", content_properties["Name"])
+ except DBusException, e:
assert not jp.can_do_video()
assertEquals (cs.NOT_AVAILABLE, e.get_dbus_name ())
--
1.5.6.5
More information about the telepathy-commits
mailing list