[telepathy-gabble/master] tubetestutil: re-implement set_up_echo using create_server

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 29 10:44:56 PDT 2009


---
 tests/twisted/tubes/tubetestutil.py |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index 93fa506..0484b11 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -209,20 +209,13 @@ class Echo(Protocol):
     def dataReceived(self, data):
         self.transport.write(data.lower())
 
-def set_up_echo(name):
+def set_up_echo(q, address_type):
     """
-    Sets up an instance of Echo listening on "%s/stream%s" % (cwd, name)
+    Sets up an instance of Echo listenning on a socket of type @address_type
     """
     factory = Factory()
     factory.protocol = Echo
-    full_path = os.getcwd() + '/stream' + name
-    try:
-        os.remove(full_path)
-    except OSError, e:
-        if e.errno != errno.ENOENT:
-            raise
-    reactor.listenUNIX(full_path, factory)
-    return full_path
+    return create_server(q, address_type, factory)
 
 def connect_socket(q, address_type, address):
     factory = EventProtocolClientFactory(q)
-- 
1.5.6.5




More information about the telepathy-commits mailing list