diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-05-15 04:20:56 +0100 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-05-15 04:20:56 +0100 |
commit | ce4a2bbd05f42d258f9bf7880060a604ac1a866e (patch) | |
tree | d784c0b21d55389590bcbec91aa486e0755490ce | |
parent | cf73fb809395da2a97e4a11a1185647e1d2b1d3d (diff) | |
download | unit-ce4a2bbd05f42d258f9bf7880060a604ac1a866e.tar.gz unit-ce4a2bbd05f42d258f9bf7880060a604ac1a866e.tar.bz2 |
Tests: style.
34 files changed, 60 insertions, 43 deletions
diff --git a/test/run.py b/test/run.py index 59e06bcb..384663f9 100755 --- a/test/run.py +++ b/test/run.py @@ -1,8 +1,7 @@ #!/usr/bin/env python3 - -import unittest -import sys import os +import sys +import unittest if __name__ == '__main__': loader = unittest.TestLoader() diff --git a/test/test_access_log.py b/test/test_access_log.py index 9287097f..3ef8f7a0 100644 --- a/test/test_access_log.py +++ b/test/test_access_log.py @@ -1,7 +1,6 @@ -import os -import re import time import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_configuration.py b/test/test_configuration.py index 24efc914..0329ef5e 100644 --- a/test/test_configuration.py +++ b/test/test_configuration.py @@ -1,4 +1,5 @@ import unittest + from unit.control import TestControl diff --git a/test/test_go_isolation.py b/test/test_go_isolation.py index cf78959a..e6aade9b 100644 --- a/test/test_go_isolation.py +++ b/test/test_go_isolation.py @@ -1,7 +1,7 @@ -import pwd import grp -import json +import pwd import unittest + from unit.applications.lang.go import TestApplicationGo from unit.feature.isolation import TestFeatureIsolation diff --git a/test/test_http_header.py b/test/test_http_header.py index 00d83f94..ea4520c1 100644 --- a/test/test_http_header.py +++ b/test/test_http_header.py @@ -1,4 +1,5 @@ import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_java_application.py b/test/test_java_application.py index 0b4828c7..3051ddea 100644 --- a/test/test_java_application.py +++ b/test/test_java_application.py @@ -1,7 +1,7 @@ import io import os import time -import unittest + from unit.applications.lang.java import TestApplicationJava diff --git a/test/test_java_websockets.py b/test/test_java_websockets.py index 0f8f62a5..d78f7263 100644 --- a/test/test_java_websockets.py +++ b/test/test_java_websockets.py @@ -1,6 +1,7 @@ -import time import struct +import time import unittest + from unit.applications.lang.java import TestApplicationJava from unit.applications.websockets import TestApplicationWebsocket diff --git a/test/test_node_application.py b/test/test_node_application.py index ed32357d..e46cc6a1 100644 --- a/test/test_node_application.py +++ b/test/test_node_application.py @@ -1,4 +1,5 @@ import unittest + from unit.applications.lang.node import TestApplicationNode diff --git a/test/test_node_websockets.py b/test/test_node_websockets.py index 14921991..1928d8c9 100644 --- a/test/test_node_websockets.py +++ b/test/test_node_websockets.py @@ -1,6 +1,7 @@ -import time import struct +import time import unittest + from unit.applications.lang.node import TestApplicationNode from unit.applications.websockets import TestApplicationWebsocket diff --git a/test/test_perl_application.py b/test/test_perl_application.py index 612c0792..dbf6abf7 100644 --- a/test/test_perl_application.py +++ b/test/test_perl_application.py @@ -1,4 +1,5 @@ import unittest + from unit.applications.lang.perl import TestApplicationPerl diff --git a/test/test_php_application.py b/test/test_php_application.py index 746d61d5..1259d22d 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -1,7 +1,7 @@ import os -import re import shutil import unittest + from unit.applications.lang.php import TestApplicationPHP class TestPHPApplication(TestApplicationPHP): diff --git a/test/test_proxy.py b/test/test_proxy.py index c163b14d..feec1ac4 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -1,7 +1,8 @@ import re -import time import socket +import time import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_python_application.py b/test/test_python_application.py index d7d39be2..8bd3f750 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -1,9 +1,9 @@ -import re -import os import grp import pwd +import re import time import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_python_procman.py b/test/test_python_procman.py index daa2c53d..8613f58e 100644 --- a/test/test_python_procman.py +++ b/test/test_python_procman.py @@ -1,7 +1,8 @@ import re -import time import subprocess +import time import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_respawn.py b/test/test_respawn.py index e7eef004..f1c71a20 100644 --- a/test/test_respawn.py +++ b/test/test_respawn.py @@ -1,7 +1,7 @@ import re -import time import subprocess -import unittest +import time + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_return.py b/test/test_return.py index fcb51745..a89d97e6 100644 --- a/test/test_return.py +++ b/test/test_return.py @@ -1,5 +1,5 @@ import re -import unittest + from unit.applications.proto import TestApplicationProto diff --git a/test/test_routing.py b/test/test_routing.py index 9e45707e..5c4de519 100644 --- a/test/test_routing.py +++ b/test/test_routing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- - import unittest + from unit.applications.proto import TestApplicationProto @@ -1871,5 +1871,6 @@ class TestRouting(TestApplicationProto): self.assertEqual(self.get()['status'], 200, 'proxy') + if __name__ == '__main__': TestRouting.main() diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 90ebd6a8..4709df6c 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -1,4 +1,5 @@ import unittest + from unit.applications.lang.ruby import TestApplicationRuby diff --git a/test/test_settings.py b/test/test_settings.py index 0b471d4e..6600358d 100644 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -1,6 +1,7 @@ -import time import socket +import time import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_share_fallback.py b/test/test_share_fallback.py index 3f288d89..ca5e2678 100644 --- a/test/test_share_fallback.py +++ b/test/test_share_fallback.py @@ -1,5 +1,5 @@ import os -import unittest + from unit.applications.proto import TestApplicationProto diff --git a/test/test_static.py b/test/test_static.py index b2489aa0..bee5db28 100644 --- a/test/test_static.py +++ b/test/test_static.py @@ -1,6 +1,7 @@ import os import socket import unittest + from unit.applications.proto import TestApplicationProto diff --git a/test/test_tls.py b/test/test_tls.py index c482bf5a..a0434174 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -1,9 +1,9 @@ import io -import os import re import ssl import subprocess import unittest + from unit.applications.tls import TestApplicationTLS diff --git a/test/test_upstreams_rr.py b/test/test_upstreams_rr.py index 56d4cbbb..2f74fbde 100644 --- a/test/test_upstreams_rr.py +++ b/test/test_upstreams_rr.py @@ -1,6 +1,6 @@ import os import re -import unittest + from unit.applications.lang.python import TestApplicationPython diff --git a/test/test_usr1.py b/test/test_usr1.py index 0627ca1d..d1db652f 100644 --- a/test/test_usr1.py +++ b/test/test_usr1.py @@ -1,6 +1,6 @@ import os -import unittest from subprocess import call + from unit.applications.lang.python import TestApplicationPython diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py index e0f83c0a..9070beb6 100644 --- a/test/unit/applications/lang/go.py +++ b/test/unit/applications/lang/go.py @@ -1,5 +1,6 @@ import os import subprocess + from unit.applications.proto import TestApplicationProto diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index a8a09ce5..c2c6dc51 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -1,7 +1,8 @@ -import os import glob +import os import shutil import subprocess + from unit.applications.proto import TestApplicationProto diff --git a/test/unit/applications/lang/node.py b/test/unit/applications/lang/node.py index 1f5d5027..cf2a99f6 100644 --- a/test/unit/applications/lang/node.py +++ b/test/unit/applications/lang/node.py @@ -1,6 +1,7 @@ import os import shutil from urllib.parse import quote + from unit.applications.proto import TestApplicationProto diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py index ae1af354..244cb5be 100644 --- a/test/unit/applications/proto.py +++ b/test/unit/applications/proto.py @@ -1,5 +1,6 @@ import re import time + from unit.control import TestControl diff --git a/test/unit/applications/tls.py b/test/unit/applications/tls.py index 9213974a..e6a846b2 100644 --- a/test/unit/applications/tls.py +++ b/test/unit/applications/tls.py @@ -2,6 +2,7 @@ import os import re import ssl import subprocess + from unit.applications.proto import TestApplicationProto diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py index fc15e8e4..e0dd2c0d 100644 --- a/test/unit/applications/websockets.py +++ b/test/unit/applications/websockets.py @@ -1,10 +1,11 @@ -import re -import random import base64 -import struct -import select import hashlib import itertools +import random +import re +import select +import struct + from unit.applications.proto import TestApplicationProto GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" diff --git a/test/unit/control.py b/test/unit/control.py index 0b344ed5..029072b5 100644 --- a/test/unit/control.py +++ b/test/unit/control.py @@ -1,4 +1,5 @@ import json + from unit.http import TestHTTP diff --git a/test/unit/feature/isolation.py b/test/unit/feature/isolation.py index 3f474993..4f33d04a 100644 --- a/test/unit/feature/isolation.py +++ b/test/unit/feature/isolation.py @@ -1,6 +1,5 @@ import os -import json -from unit.applications.proto import TestApplicationProto + from unit.applications.lang.go import TestApplicationGo from unit.applications.lang.java import TestApplicationJava from unit.applications.lang.node import TestApplicationNode @@ -8,6 +7,7 @@ from unit.applications.lang.perl import TestApplicationPerl from unit.applications.lang.php import TestApplicationPHP from unit.applications.lang.python import TestApplicationPython from unit.applications.lang.ruby import TestApplicationRuby +from unit.applications.proto import TestApplicationProto class TestFeatureIsolation(TestApplicationProto): diff --git a/test/unit/http.py b/test/unit/http.py index 13384dc8..de3bb2a4 100644 --- a/test/unit/http.py +++ b/test/unit/http.py @@ -1,11 +1,12 @@ import binascii import io +import json import os import re -import time -import json -import socket import select +import socket +import time + from unit.main import TestUnit diff --git a/test/unit/main.py b/test/unit/main.py index 074d053e..42918c9d 100644 --- a/test/unit/main.py +++ b/test/unit/main.py @@ -1,17 +1,17 @@ +import argparse +import atexit +import fcntl import os +import platform import re -import sys -import stat -import time -import fcntl -import atexit import shutil import signal -import argparse -import platform +import stat +import subprocess +import sys import tempfile +import time import unittest -import subprocess from multiprocessing import Process @@ -410,4 +410,3 @@ class TestUnit(unittest.TestCase): data = f.read() print(data) - |