- change test cod directory/
This commit is contained in:
liris
2014-03-18 09:16:39 +09:00
parent a0e0d5f966
commit 4900b04f43
5 changed files with 10 additions and 3 deletions

View File

@@ -25,5 +25,7 @@ setup(
], ],
keywords='websockets', keywords='websockets',
py_modules=["websocket"], py_modules=["websocket"],
scripts=["bin/wsdump.py"] scripts=["bin/wsdump.py"],
packages=["tests"],
package_data={'tests': ['data/*.txt']},
) )

0
tests/__init__.py Normal file
View File

View File

@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
import sys
sys.path[0:0] = [""]
import os.path
import base64 import base64
import socket import socket
try: try:
@@ -24,7 +28,7 @@ import websocket as ws
# "RFC6455: 5.4. Fragmentation" # "RFC6455: 5.4. Fragmentation"
# #
TEST_FRAGMENTATION = True TEST_FRAGMENTATION = True
TEST_WITH_INTERNET = False TEST_WITH_INTERNET = True
TRACABLE = False TRACABLE = False
@@ -59,7 +63,8 @@ class HeaderSockMock(SockMock):
def __init__(self, fname): def __init__(self, fname):
SockMock.__init__(self) SockMock.__init__(self)
self.add_packet(open(fname).read()) path = os.path.join(os.path.dirname(__file__), fname)
self.add_packet(open(path).read())
class WebSocketTest(unittest.TestCase): class WebSocketTest(unittest.TestCase):