[Telepathy-commits] [telepathy-gabble/master] use path returned by set_up_echo

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Feb 27 05:27:45 PST 2009


---
 ...offer-accept-private-stream-tube-si-fallback.py |    6 ++----
 tests/twisted/tubes/offer-no-caps.py               |    9 +++------
 tests/twisted/tubes/offer-private-stream-tube.py   |   13 ++++---------
 3 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/tests/twisted/tubes/offer-accept-private-stream-tube-si-fallback.py b/tests/twisted/tubes/offer-accept-private-stream-tube-si-fallback.py
index a84d3e5..15a365a 100644
--- a/tests/twisted/tubes/offer-accept-private-stream-tube-si-fallback.py
+++ b/tests/twisted/tubes/offer-accept-private-stream-tube-si-fallback.py
@@ -1,7 +1,6 @@
 """Test stream initiation fallback."""
 
 import base64
-import os
 
 import dbus
 from dbus.connection import Connection
@@ -18,7 +17,7 @@ from twisted.words.protocols.jabber.client import IQ
 import tubetestutil as t
 
 def test(q, bus, conn, stream):
-    t.set_up_echo('')
+    echo_path = t.set_up_echo('')
 
     conn.Connect()
 
@@ -87,9 +86,8 @@ def test(q, bus, conn, stream):
     tube_iface = dbus.Interface(tube_chan,
         tp_name_prefix + '.Channel.Type.StreamTube.DRAFT')
 
-    path = os.getcwd() + '/stream'
     call_async(q, tube_iface, 'OfferStreamTube',
-        0, dbus.ByteArray(path), 0, "", {'foo': 'bar'})
+        0, dbus.ByteArray(echo_path), 0, "", {'foo': 'bar'})
 
     event = q.expect('stream-message')
     message = event.stanza
diff --git a/tests/twisted/tubes/offer-no-caps.py b/tests/twisted/tubes/offer-no-caps.py
index 862b67f..88627f4 100644
--- a/tests/twisted/tubes/offer-no-caps.py
+++ b/tests/twisted/tubes/offer-no-caps.py
@@ -3,7 +3,6 @@ Test that offering a tube to a contact without tube capabilities fails
 appropriately.
 """
 
-import os
 import dbus
 
 from twisted.words.xish import domish
@@ -24,7 +23,7 @@ def props(ct, extra=None):
     return ret
 
 def test(q, bus, conn, stream):
-    t.set_up_echo("")
+    echo_path = t.set_up_echo("")
 
     conn.Connect()
 
@@ -82,10 +81,8 @@ def test(q, bus, conn, stream):
     e = q.expect('dbus-error', method='OfferDBusTube').error
     assert e.get_dbus_name() == cs.NOT_AVAILABLE, e.get_dbus_name()
 
-    # FIXME: make set_up_echo return this
-    path = os.getcwd() + '/stream'
     call_async(q, tubes, 'OfferStreamTube', 'echo', {},
-        cs.SOCKET_ADDRESS_TYPE_UNIX, dbus.ByteArray(path),
+        cs.SOCKET_ADDRESS_TYPE_UNIX, dbus.ByteArray(echo_path),
         cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "")
     e = q.expect('dbus-error', method='OfferStreamTube').error
     assert e.get_dbus_name() == cs.NOT_AVAILABLE, e.get_dbus_name()
@@ -98,7 +95,7 @@ def test(q, bus, conn, stream):
     st_chan = bus.get_object(conn.bus_name, st_path)
     st = dbus.Interface(st_chan, cs.CHANNEL_TYPE_STREAM_TUBE)
     call_async(q, st, 'OfferStreamTube', cs.SOCKET_ADDRESS_TYPE_UNIX,
-        dbus.ByteArray(path), cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "", {})
+        dbus.ByteArray(echo_path), cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "", {})
     e = q.expect('dbus-error', method='OfferStreamTube').error
     assert e.get_dbus_name() == cs.NOT_AVAILABLE, e.get_dbus_name()
 
diff --git a/tests/twisted/tubes/offer-private-stream-tube.py b/tests/twisted/tubes/offer-private-stream-tube.py
index 9df79b4..5440bff 100644
--- a/tests/twisted/tubes/offer-private-stream-tube.py
+++ b/tests/twisted/tubes/offer-private-stream-tube.py
@@ -1,7 +1,5 @@
 """Test 1-1 tubes support."""
 
-import os
-
 import dbus
 
 from servicetest import call_async, EventPattern, sync_dbus
@@ -43,8 +41,8 @@ def contact_offer_dbus_tube(bytestream, tube_id):
     bytestream.stream.send(iq)
 
 def test(q, bus, conn, stream, bytestream_cls):
-    t.set_up_echo("")
-    t.set_up_echo("2")
+    echo_path = t.set_up_echo("")
+    echo2_path = t.set_up_echo("2")
 
     t.check_conn_properties(q, conn)
 
@@ -183,10 +181,8 @@ def test(q, bus, conn, stream, bytestream_cls):
             bob_handle, "bob at localhost")
 
     # Create another tube using old API
-    # FIXME: make set_up_echo return this
-    path = os.getcwd() + '/stream'
     call_async(q, tubes_iface, 'OfferStreamTube',
-        'echo', sample_parameters, 0, dbus.ByteArray(path), 0, "")
+        'echo', sample_parameters, 0, dbus.ByteArray(echo_path), 0, "")
 
     event, return_event, new_chan, new_chans = q.expect_many(
         EventPattern('stream-message'),
@@ -265,9 +261,8 @@ def test(q, bus, conn, stream, bytestream_cls):
             cs.TUBE_CHANNEL_STATE_REMOTE_PENDING)
 
     # Offer the first tube created (new API)
-    path2 = os.getcwd() + '/stream2'
     call_async(q, new_tube_iface, 'OfferStreamTube',
-        0, dbus.ByteArray(path2), 0, "", new_sample_parameters)
+        0, dbus.ByteArray(echo2_path), 0, "", new_sample_parameters)
 
     msg_event, new_tube_sig, state_event = q.expect_many(
         EventPattern('stream-message'),
-- 
1.5.6.5




More information about the telepathy-commits mailing list