summaryrefslogtreecommitdiff
path: root/websocket/tests
diff options
context:
space:
mode:
Diffstat (limited to 'websocket/tests')
-rw-r--r--websocket/tests/test_abnf.py8
-rw-r--r--websocket/tests/test_app.py14
-rw-r--r--websocket/tests/test_cookiejar.py7
-rw-r--r--websocket/tests/test_http.py18
-rw-r--r--websocket/tests/test_url.py8
-rw-r--r--websocket/tests/test_websocket.py25
6 files changed, 36 insertions, 44 deletions
diff --git a/websocket/tests/test_abnf.py b/websocket/tests/test_abnf.py
index 3521aea..7c9d89d 100644
--- a/websocket/tests/test_abnf.py
+++ b/websocket/tests/test_abnf.py
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
#
+import websocket as ws
+from websocket._abnf import *
+import unittest
+
"""
test_abnf.py
websocket - WebSocket client library for Python
@@ -19,10 +23,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import websocket as ws
-from websocket._abnf import *
-import unittest
-
class ABNFTest(unittest.TestCase):
diff --git a/websocket/tests/test_app.py b/websocket/tests/test_app.py
index 94abf0c..ac2a7dd 100644
--- a/websocket/tests/test_app.py
+++ b/websocket/tests/test_app.py
@@ -1,5 +1,12 @@
# -*- coding: utf-8 -*-
#
+import os
+import os.path
+import threading
+import websocket as ws
+import ssl
+import unittest
+
"""
test_app.py
websocket - WebSocket client library for Python
@@ -19,13 +26,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import os
-import os.path
-import threading
-import websocket as ws
-import ssl
-import unittest
-
# Skip test to access the internet unless TEST_WITH_INTERNET == 1
TEST_WITH_INTERNET = os.environ.get('TEST_WITH_INTERNET', '0') == '1'
# Skip tests relying on local websockets server unless LOCAL_WS_SERVER_PORT != -1
diff --git a/websocket/tests/test_cookiejar.py b/websocket/tests/test_cookiejar.py
index 93c8ec1..559b2e0 100644
--- a/websocket/tests/test_cookiejar.py
+++ b/websocket/tests/test_cookiejar.py
@@ -1,6 +1,5 @@
-"""
-
-"""
+import unittest
+from websocket._cookiejar import SimpleCookieJar
"""
test_cookiejar.py
@@ -20,8 +19,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
-import unittest
-from websocket._cookiejar import SimpleCookieJar
class CookieJarTest(unittest.TestCase):
diff --git a/websocket/tests/test_http.py b/websocket/tests/test_http.py
index b5b1f13..649e0fe 100644
--- a/websocket/tests/test_http.py
+++ b/websocket/tests/test_http.py
@@ -1,5 +1,14 @@
# -*- coding: utf-8 -*-
#
+import os
+import os.path
+import websocket as ws
+from websocket._http import proxy_info, read_headers, _start_proxied_socket, _tunnel, _get_addrinfo_list, connect
+import unittest
+import ssl
+import websocket
+import socket
+
"""
test_http.py
websocket - WebSocket client library for Python
@@ -19,15 +28,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import os
-import os.path
-import websocket as ws
-from websocket._http import proxy_info, read_headers, _start_proxied_socket, _tunnel, _get_addrinfo_list, connect
-import unittest
-import ssl
-import websocket
-import socket
-
try:
from python_socks._errors import ProxyError, ProxyTimeoutError, ProxyConnectionError
except:
diff --git a/websocket/tests/test_url.py b/websocket/tests/test_url.py
index bd6e90a..7e155fd 100644
--- a/websocket/tests/test_url.py
+++ b/websocket/tests/test_url.py
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
#
+import os
+import unittest
+from websocket._url import get_proxy_info, parse_url, _is_address_in_network, _is_no_proxy_host
+
"""
test_url.py
websocket - WebSocket client library for Python
@@ -19,10 +23,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import os
-import unittest
-from websocket._url import get_proxy_info, parse_url, _is_address_in_network, _is_no_proxy_host
-
class UrlTest(unittest.TestCase):
diff --git a/websocket/tests/test_websocket.py b/websocket/tests/test_websocket.py
index e888811..ae42ab5 100644
--- a/websocket/tests/test_websocket.py
+++ b/websocket/tests/test_websocket.py
@@ -1,8 +1,15 @@
# -*- coding: utf-8 -*-
#
-"""
-
-"""
+import os
+import os.path
+import socket
+import websocket as ws
+import unittest
+from websocket._handshake import _create_sec_websocket_key, \
+ _validate as _validate_header
+from websocket._http import read_headers
+from websocket._utils import validate_utf8
+from base64 import decodebytes as base64decode
"""
test_websocket.py
@@ -23,18 +30,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import os
-import os.path
-import socket
-import websocket as ws
-from websocket._handshake import _create_sec_websocket_key, \
- _validate as _validate_header
-from websocket._http import read_headers
-from websocket._utils import validate_utf8
-from base64 import decodebytes as base64decode
-
-import unittest
-
try:
import ssl
from ssl import SSLError