Tests: style.
This commit is contained in:
@@ -14,7 +14,6 @@ import time
|
||||
from multiprocessing import Process
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.check.chroot import check_chroot
|
||||
from unit.check.go import check_go
|
||||
from unit.check.isolation import check_isolation
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import os
|
||||
|
||||
def application(environ, start_response):
|
||||
body = "v1".encode()
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import os
|
||||
|
||||
def application(environ, start_response):
|
||||
body = "v2".encode()
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
class Foo(threading.Thread):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
class Foo(threading.Thread):
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import asyncio
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
async def application(scope, receive, send):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
def application(environ, start_response):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cgi
|
||||
from tempfile import TemporaryFile
|
||||
import os, cgi
|
||||
|
||||
|
||||
def read(environ):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import time
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import pytest
|
||||
|
||||
from conftest import unit_stop
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import time
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.applications.websockets import TestApplicationWebsocket
|
||||
from unit.option import option
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import socket
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.control import TestControl
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import os
|
||||
import pwd
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.go import TestApplicationGo
|
||||
from unit.option import option
|
||||
from unit.utils import getns
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.go import TestApplicationGo
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.java import TestApplicationJava
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import struct
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.java import TestApplicationJava
|
||||
from unit.applications.websockets import TestApplicationWebsocket
|
||||
from unit.option import option
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.node import TestApplicationNode
|
||||
from unit.utils import waitforfiles
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.node import TestApplicationNode
|
||||
from unit.applications.websockets import TestApplicationWebsocket
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import struct
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.node import TestApplicationNode
|
||||
from unit.applications.websockets import TestApplicationWebsocket
|
||||
from unit.option import option
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.perl import TestApplicationPerl
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import signal
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.php import TestApplicationPHP
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.php import TestApplicationPHP
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import socket
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from conftest import run_process
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
@@ -5,7 +5,6 @@ import re
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
from unit.utils import findmnt
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import subprocess
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
@@ -265,7 +264,8 @@ class TestPythonProcman(TestApplicationPython):
|
||||
|
||||
assert len(self.pids_for_process()) == 1, 'longstarts == 1'
|
||||
|
||||
pid = self.get()['body']
|
||||
self.get()
|
||||
|
||||
pids = self.pids_for_process()
|
||||
assert len(pids) == 2, 'longstarts == 2'
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import re
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.ruby import TestApplicationRuby
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import os
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from conftest import unit_stop
|
||||
from unit.applications.lang.ruby import TestApplicationRuby
|
||||
from unit.option import option
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.ruby import TestApplicationRuby
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import socket
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import TestApplicationPython
|
||||
from unit.utils import sysctl
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
import socket
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
from unit.option import option
|
||||
from unit.utils import waitforfiles
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
@@ -132,7 +131,7 @@ class TestStaticChroot(TestApplicationProto):
|
||||
|
||||
assert self.get(url=self.test_path)['status'] == 200, 'relative'
|
||||
|
||||
def test_static_chroot_varibales(self, temp_dir):
|
||||
def test_static_chroot_variables(self, temp_dir):
|
||||
assert 'success' in self.update_action(
|
||||
temp_dir + '/assets$uri', temp_dir + '/assets/$host'
|
||||
)
|
||||
@@ -143,21 +142,21 @@ class TestStaticChroot(TestApplicationProto):
|
||||
)
|
||||
assert self.get_custom('/dir/file', 'dir') == 200
|
||||
|
||||
def test_static_chroot_varibales_buildin_start(self, temp_dir):
|
||||
def test_static_chroot_variables_buildin_start(self, temp_dir):
|
||||
assert 'success' in self.update_action(
|
||||
temp_dir + '/assets/dir/$host', '$uri/assets/dir'
|
||||
)
|
||||
|
||||
assert self.get_custom(temp_dir, 'file') == 200
|
||||
|
||||
def test_static_chroot_varibales_buildin_mid(self, temp_dir):
|
||||
def test_static_chroot_variables_buildin_mid(self, temp_dir):
|
||||
assert 'success' in self.update_action(
|
||||
temp_dir + '/assets$uri', temp_dir + '/$host/dir'
|
||||
)
|
||||
|
||||
assert self.get_custom('/dir/file', 'assets') == 200
|
||||
|
||||
def test_static_chroot_varibales_buildin_end(self, temp_dir):
|
||||
def test_static_chroot_variables_buildin_end(self, temp_dir):
|
||||
assert 'success' in self.update_action(
|
||||
temp_dir + '/assets$uri', temp_dir + '/assets/$host'
|
||||
)
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
@@ -30,7 +29,7 @@ class TestStaticVariables(TestApplicationProto):
|
||||
|
||||
return self.conf('"' + share + '"', 'routes/0/action/share')
|
||||
|
||||
def test_static_varibales(self, temp_dir):
|
||||
def test_static_variables(self, temp_dir):
|
||||
assert self.get(url='/index.html')['status'] == 200
|
||||
assert self.get(url='/d$r/file')['status'] == 200
|
||||
|
||||
@@ -40,7 +39,7 @@ class TestStaticVariables(TestApplicationProto):
|
||||
assert 'success' in self.update_share(temp_dir + '/assets${uri}')
|
||||
assert self.get(url='/index.html')['status'] == 200
|
||||
|
||||
def test_static_varibales_array(self, temp_dir):
|
||||
def test_static_variables_array(self, temp_dir):
|
||||
assert 'success' in self.update_share(
|
||||
[temp_dir + '/assets$uri', '$uri']
|
||||
)
|
||||
@@ -61,18 +60,18 @@ class TestStaticVariables(TestApplicationProto):
|
||||
assert self.get(url=temp_dir + '/assets/index.html')['status'] == 200
|
||||
assert self.get(url='/dir/blah')['status'] == 201
|
||||
|
||||
def test_static_varibales_buildin_start(self, temp_dir):
|
||||
def test_static_variables_buildin_start(self, temp_dir):
|
||||
assert 'success' in self.update_share('$uri/assets/index.html')
|
||||
assert self.get(url=temp_dir)['status'] == 200
|
||||
|
||||
def test_static_varibales_buildin_mid(self, temp_dir):
|
||||
def test_static_variables_buildin_mid(self, temp_dir):
|
||||
assert 'success' in self.update_share(temp_dir + '$uri/index.html')
|
||||
assert self.get(url='/assets')['status'] == 200
|
||||
|
||||
def test_static_varibales_buildin_end(self):
|
||||
def test_static_variables_buildin_end(self):
|
||||
assert self.get(url='/index.html')['status'] == 200
|
||||
|
||||
def test_static_varibales_invalid(self, temp_dir):
|
||||
def test_static_variables_invalid(self, temp_dir):
|
||||
assert 'error' in self.update_share(temp_dir + '/assets/d$r$uri')
|
||||
assert 'error' in self.update_share(temp_dir + '/assets/$$uri')
|
||||
assert 'error' in self.update_share(
|
||||
|
||||
@@ -5,7 +5,6 @@ import subprocess
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.tls import TestApplicationTLS
|
||||
from unit.option import option
|
||||
|
||||
@@ -677,4 +676,3 @@ basicConstraints = critical,CA:TRUE"""
|
||||
assert self.get_ssl()['status'] == 200, 'listener #1'
|
||||
|
||||
assert self.get_ssl(port=7081)['status'] == 200, 'listener #2'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import ssl
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.tls import TestApplicationTLS
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import ssl
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.tls import TestApplicationTLS
|
||||
from unit.option import option
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
|
||||
@@ -3,8 +3,8 @@ import re
|
||||
import time
|
||||
|
||||
from unit.control import TestControl
|
||||
from unit.option import option
|
||||
from unit.log import Log
|
||||
from unit.option import option
|
||||
|
||||
|
||||
class TestApplicationProto(TestControl):
|
||||
|
||||
@@ -3,8 +3,8 @@ import os
|
||||
|
||||
from unit.applications.lang.go import TestApplicationGo
|
||||
from unit.applications.lang.java import TestApplicationJava
|
||||
from unit.applications.lang.ruby import TestApplicationRuby
|
||||
from unit.applications.lang.node import TestApplicationNode
|
||||
from unit.applications.lang.ruby import TestApplicationRuby
|
||||
from unit.applications.proto import TestApplicationProto
|
||||
from unit.http import TestHTTP
|
||||
from unit.option import option
|
||||
|
||||
Reference in New Issue
Block a user