[Telepathy-commits] [telepathy-gabble/master] Various Jingle tests: assert that GetHandle() returns the right thing in all cases

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Mar 10 11:05:44 PDT 2009


---
 tests/twisted/jingle/test-incoming-call.py         |    2 ++
 .../jingle/test-outgoing-call-deprecated.py        |    5 ++++-
 .../jingle/test-outgoing-call-deprecated2.py       |    4 ++++
 .../jingle/test-outgoing-call-requestotron.py      |    3 +++
 tests/twisted/jingle/test-outgoing-call.py         |    2 ++
 5 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/jingle/test-incoming-call.py b/tests/twisted/jingle/test-incoming-call.py
index 2469506..6254fc9 100644
--- a/tests/twisted/jingle/test-incoming-call.py
+++ b/tests/twisted/jingle/test-incoming-call.py
@@ -85,6 +85,8 @@ def test(q, bus, conn, stream):
             dbus_interface=dbus.PROPERTIES_IFACE)
     assert channel_props['TargetHandle'] == remote_handle
     assert channel_props['TargetHandleType'] == cs.HT_CONTACT
+    assert media_chan.GetHandle(dbus_interface=cs.CHANNEL) == (cs.HT_CONTACT,
+            remote_handle)
     assert channel_props['TargetID'] == 'foo at bar.com'
     assert channel_props['InitiatorID'] == 'foo at bar.com'
     assert channel_props['InitiatorHandle'] == remote_handle
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated.py b/tests/twisted/jingle/test-outgoing-call-deprecated.py
index 5fca32b..8e76293 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated.py
@@ -11,6 +11,7 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
 
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
@@ -52,8 +53,10 @@ def test(q, bus, conn, stream):
     channel_props = group_iface.GetAll(
             'org.freedesktop.Telepathy.Channel',
             dbus_interface=dbus.PROPERTIES_IFACE)
-    assert channel_props['TargetHandleType'] == 1, channel_props
+    assert channel_props['TargetHandleType'] == cs.HT_CONTACT, channel_props
     assert channel_props['TargetHandle'] == handle, channel_props
+    assert media_iface.GetHandle(dbus_interface=cs.CHANNEL) == (cs.HT_CONTACT,
+            handle)
     assert channel_props['TargetID'] == 'foo at bar.com', channel_props
     assert channel_props['Requested'] == True
     assert channel_props['InitiatorID'] == 'test at localhost'
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated2.py b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
index 7ba04b5..9abf9bc 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated2.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
@@ -11,6 +11,7 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
 
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
@@ -52,6 +53,9 @@ def test(q, bus, conn, stream):
     channel_props = group_iface.GetAll(
             'org.freedesktop.Telepathy.Channel',
             dbus_interface=dbus.PROPERTIES_IFACE)
+    assert media_iface.GetHandle(dbus_interface=cs.CHANNEL) == (0, 0)
+    assert channel_props['TargetHandleType'] == 0, channel_props
+    assert channel_props['TargetHandle'] == 0, channel_props
     assert channel_props['TargetID'] == '', channel_props
     assert channel_props['Requested'] == True
     assert channel_props['InitiatorID'] == 'test at localhost'
diff --git a/tests/twisted/jingle/test-outgoing-call-requestotron.py b/tests/twisted/jingle/test-outgoing-call-requestotron.py
index 22e65ed..05a43fb 100644
--- a/tests/twisted/jingle/test-outgoing-call-requestotron.py
+++ b/tests/twisted/jingle/test-outgoing-call-requestotron.py
@@ -13,6 +13,7 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
 
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
@@ -105,6 +106,8 @@ def test(q, bus, conn, stream):
             channel_props.get('TargetHandle')
     assert channel_props.get('TargetHandleType') == 1,\
             channel_props.get('TargetHandleType')
+    assert media_iface.GetHandle(dbus_interface=cs.CHANNEL) == (cs.HT_CONTACT,
+            handle)
     assert channel_props.get('ChannelType') == \
             'org.freedesktop.Telepathy.Channel.Type.StreamedMedia',\
             channel_props.get('ChannelType')
diff --git a/tests/twisted/jingle/test-outgoing-call.py b/tests/twisted/jingle/test-outgoing-call.py
index 1240570..15092db 100644
--- a/tests/twisted/jingle/test-outgoing-call.py
+++ b/tests/twisted/jingle/test-outgoing-call.py
@@ -13,6 +13,7 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
 
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
@@ -95,6 +96,7 @@ def test(q, bus, conn, stream):
             channel_props.get('TargetHandle')
     assert channel_props.get('TargetHandleType') == 0,\
             channel_props.get('TargetHandleType')
+    assert media_iface.GetHandle(dbus_interface=cs.CHANNEL) == (0, 0)
     assert channel_props.get('ChannelType') == \
             'org.freedesktop.Telepathy.Channel.Type.StreamedMedia',\
             channel_props.get('ChannelType')
-- 
1.5.6.5




More information about the telepathy-commits mailing list