summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2013-10-29 09:37:02 -0500
committerJoel Martin <github@martintribe.org>2013-10-29 09:41:26 -0500
commit13c99bcf053f7f3af8ba84c0d963a9591e020f49 (patch)
tree925d5b9a2c6f25aff41387e4257c3e1bc039d5a6
parentb4e0b534d5d04d57265045b4baf49dd81555064b (diff)
downloadwebsockify-13c99bcf053f7f3af8ba84c0d963a9591e020f49.tar.gz
Fix search path construction in tests.
This way the tests can be run directly from within the tests directory and they might also have a chance of running on Windows (where the path separator is different).
-rwxr-xr-xtests/echo.py4
-rwxr-xr-xtests/load.py4
-rwxr-xr-xtests/utf8-list.py5
3 files changed, 6 insertions, 7 deletions
diff --git a/tests/echo.py b/tests/echo.py
index d79553e..1d46d50 100755
--- a/tests/echo.py
+++ b/tests/echo.py
@@ -11,8 +11,8 @@ as taken from http://docs.python.org/dev/library/ssl.html#certificates
'''
import os, sys, select, optparse
-sys.path.insert(0,os.path.dirname(__file__) + "/../websockify")
-from websocket import WebSocketServer
+sys.path.insert(0,os.path.join(os.path.dirname(__file__), ".."))
+from websockify.websocket import WebSocketServer
class WebSocketEcho(WebSocketServer):
"""
diff --git a/tests/load.py b/tests/load.py
index 0da7265..e1354c9 100755
--- a/tests/load.py
+++ b/tests/load.py
@@ -7,8 +7,8 @@ given a sequence number. Any errors are reported and counted.
'''
import sys, os, select, random, time, optparse
-sys.path.insert(0,os.path.dirname(__file__) + "/../websockify")
-from websocket import WebSocketServer
+sys.path.insert(0,os.path.join(os.path.dirname(__file__), ".."))
+from websockify.websocket import WebSocketServer
class WebSocketLoad(WebSocketServer):
diff --git a/tests/utf8-list.py b/tests/utf8-list.py
index 60a8ae7..77bd430 100755
--- a/tests/utf8-list.py
+++ b/tests/utf8-list.py
@@ -5,9 +5,8 @@ Display UTF-8 encoding for 0-255.'''
import sys, os, socket, ssl, time, traceback
from select import select
-
-sys.path.insert(0,os.path.dirname(__file__) + "/../websockify")
-from websocket import WebSocketServer
+sys.path.insert(0,os.path.join(os.path.dirname(__file__), ".."))
+from websockify.websocket import WebSocketServer
if __name__ == '__main__':
print "val: hybi_base64 | hybi_binary"