[telepathy-gabble/master] Use MEDIA_STREAM_STATE_CONNECTED constant

Will Thompson will.thompson at collabora.co.uk
Fri Mar 27 04:41:18 PDT 2009


---
 tests/twisted/jingle/google-relay.py               |    2 +-
 tests/twisted/jingle/hold-audio.py                 |    3 ++-
 tests/twisted/jingle/hold-av.py                    |    6 ++++--
 tests/twisted/jingle/outgoing-not-answered.py      |    2 +-
 tests/twisted/jingle/payload-types.py              |    6 +++---
 tests/twisted/jingle/test-description-info.py      |    4 ++--
 tests/twisted/jingle/test-dialects-incoming.py     |    2 +-
 tests/twisted/jingle/test-dialects-outgoing.py     |    4 +++-
 .../jingle/test-outgoing-call-deprecated.py        |    2 +-
 .../jingle/test-outgoing-call-deprecated2.py       |    2 +-
 .../jingle/test-outgoing-call-requestotron.py      |    2 +-
 tests/twisted/jingle/test-outgoing-call.py         |    2 +-
 12 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/tests/twisted/jingle/google-relay.py b/tests/twisted/jingle/google-relay.py
index 233d7d9..74dfeca 100644
--- a/tests/twisted/jingle/google-relay.py
+++ b/tests/twisted/jingle/google-relay.py
@@ -282,7 +282,7 @@ def test(q, bus, conn, stream, incoming=True, too_slow=False):
         stream_handler.NewNativeCandidate("fake",
                 jt.get_remote_transports_dbus())
         stream_handler.Ready(jt.get_audio_codecs_dbus())
-        stream_handler.StreamState(2)
+        stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
         e = q.expect('stream-iq')
         assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/hold-audio.py b/tests/twisted/jingle/hold-audio.py
index 36ffd3b..9d35f95 100644
--- a/tests/twisted/jingle/hold-audio.py
+++ b/tests/twisted/jingle/hold-audio.py
@@ -10,6 +10,7 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
 
 MEDIA_STREAM_TYPE_AUDIO = 0
 # Hold states
@@ -76,7 +77,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/hold-av.py b/tests/twisted/jingle/hold-av.py
index 9f2f35d..841ad48 100644
--- a/tests/twisted/jingle/hold-av.py
+++ b/tests/twisted/jingle/hold-av.py
@@ -10,6 +10,8 @@ import gabbletest
 import dbus
 import time
 
+import constants as cs
+
 
 MEDIA_STREAM_TYPE_AUDIO = 0
 MEDIA_STREAM_TYPE_VIDEO = 0
@@ -84,7 +86,7 @@ def test(q, bus, conn, stream):
     audio_stream_handler.NewNativeCandidate("fake",
             jt.get_remote_transports_dbus())
     audio_stream_handler.Ready(jt.get_audio_codecs_dbus())
-    audio_stream_handler.StreamState(2)
+    audio_stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('dbus-signal', signal='NewStreamHandler')
 
@@ -95,7 +97,7 @@ def test(q, bus, conn, stream):
     video_stream_handler.NewNativeCandidate("fake",
             jt.get_remote_transports_dbus())
     video_stream_handler.Ready(jt.get_video_codecs_dbus())
-    video_stream_handler.StreamState(2)
+    video_stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/outgoing-not-answered.py b/tests/twisted/jingle/outgoing-not-answered.py
index 8d4b6c7..568c2d7 100644
--- a/tests/twisted/jingle/outgoing-not-answered.py
+++ b/tests/twisted/jingle/outgoing-not-answered.py
@@ -33,7 +33,7 @@ def test(jp, q, bus, conn, stream):
     stream_handler = make_channel_proxy(conn, e.args[0], 'Media.StreamHandler')
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     q.expect('stream-iq', predicate=lambda e:
         jp.match_jingle_action(e.query, 'session-initiate'))
diff --git a/tests/twisted/jingle/payload-types.py b/tests/twisted/jingle/payload-types.py
index 606620f..cddfe6b 100644
--- a/tests/twisted/jingle/payload-types.py
+++ b/tests/twisted/jingle/payload-types.py
@@ -12,7 +12,7 @@ import gabbletest
 import dbus
 import time
 
-MEDIA_STREAM_TYPE_AUDIO = 0
+import constants as cs
 
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test at localhost', 'foo at bar.com/Foo')
@@ -66,7 +66,7 @@ def test(q, bus, conn, stream):
     # Test that codec parameters are correctly sent in <parameter> children of
     # <payload-type> rather than as attributes of the latter.
 
-    media_iface.RequestStreams(handle, [MEDIA_STREAM_TYPE_AUDIO])
+    media_iface.RequestStreams(handle, [cs.MEDIA_STREAM_TYPE_AUDIO])
 
     # S-E gets notified about new session handler, and calls Ready on it
     e = q.expect('dbus-signal', signal='NewSessionHandler')
@@ -84,7 +84,7 @@ def test(q, bus, conn, stream):
     codecs = dbus.Array( [ (96, 'speex', 0, 16000, 0, {'vbr': 'on'}) ],
                          signature='(usuuua{ss})')
     stream_handler.Ready(codecs)
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     content = list(e.query.elements())[0]
diff --git a/tests/twisted/jingle/test-description-info.py b/tests/twisted/jingle/test-description-info.py
index bbc73fe..8f0234c 100644
--- a/tests/twisted/jingle/test-description-info.py
+++ b/tests/twisted/jingle/test-description-info.py
@@ -35,7 +35,7 @@ def test(q, bus, conn, stream):
 
         stream_handler.NewNativeCandidate("fake", jt2.get_remote_transports_dbus())
         stream_handler.Ready(jt2.get_audio_codecs_dbus())
-        stream_handler.StreamState(2)
+        stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
         return (stream_handler, stream_id)
 
 
@@ -101,7 +101,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt2.get_remote_transports_dbus())
     stream_handler.Ready(local_codecs_dbus)
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     # First IQ is transport-info; also, we expect to be told what codecs the
     # other end wants.
diff --git a/tests/twisted/jingle/test-dialects-incoming.py b/tests/twisted/jingle/test-dialects-incoming.py
index 1a4f63a..e1dadbb 100644
--- a/tests/twisted/jingle/test-dialects-incoming.py
+++ b/tests/twisted/jingle/test-dialects-incoming.py
@@ -66,7 +66,7 @@ def worker(jp, q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt2.get_remote_transports_dbus())
     stream_handler.Ready(jt2.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     # In gtalk4, first one will be transport-accept, telling us that GTalk
     # is ok with our choice of transports.
diff --git a/tests/twisted/jingle/test-dialects-outgoing.py b/tests/twisted/jingle/test-dialects-outgoing.py
index 819a558..57f6b13 100644
--- a/tests/twisted/jingle/test-dialects-outgoing.py
+++ b/tests/twisted/jingle/test-dialects-outgoing.py
@@ -10,6 +10,8 @@ import dbus
 import time
 from twisted.words.xish import xpath
 
+import constants as cs
+
 from jingletest2 import *
 
 def worker(jp, q, bus, conn, stream):
@@ -49,7 +51,7 @@ def worker(jp, q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt2.get_remote_transports_dbus())
     stream_handler.Ready(jt2.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     if jp.dialect.startswith('gtalk'):
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated.py b/tests/twisted/jingle/test-outgoing-call-deprecated.py
index 8e76293..2d75657 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated.py
@@ -79,7 +79,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated2.py b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
index 9abf9bc..43c0f11 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated2.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
@@ -80,7 +80,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/test-outgoing-call-requestotron.py b/tests/twisted/jingle/test-outgoing-call-requestotron.py
index 4f9202c..12d90f2 100644
--- a/tests/twisted/jingle/test-outgoing-call-requestotron.py
+++ b/tests/twisted/jingle/test-outgoing-call-requestotron.py
@@ -175,7 +175,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     e = q.expect('stream-iq')
     assert e.query.name == 'jingle'
diff --git a/tests/twisted/jingle/test-outgoing-call.py b/tests/twisted/jingle/test-outgoing-call.py
index b0da1ee..24e1155 100644
--- a/tests/twisted/jingle/test-outgoing-call.py
+++ b/tests/twisted/jingle/test-outgoing-call.py
@@ -162,7 +162,7 @@ def test(q, bus, conn, stream):
 
     stream_handler.NewNativeCandidate("fake", jt.get_remote_transports_dbus())
     stream_handler.Ready(jt.get_audio_codecs_dbus())
-    stream_handler.StreamState(2)
+    stream_handler.StreamState(cs.MEDIA_STREAM_STATE_CONNECTED)
 
     sh_props = stream_handler.GetAll(
             'org.freedesktop.Telepathy.Media.StreamHandler',
-- 
1.5.6.5




More information about the telepathy-commits mailing list