Tests: simplified module checking.
This commit is contained in:
@@ -6,8 +6,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestAccessLog(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def load(self, script):
|
||||
super().load(script)
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.control import TestControl
|
||||
|
||||
|
||||
class TestConfiguration(TestControl):
|
||||
def setUpClass():
|
||||
TestControl().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def test_json_empty(self):
|
||||
self.assertIn('error', self.conf(''), 'empty')
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.applications.lang.go import TestApplicationGo
|
||||
|
||||
|
||||
class TestGoApplication(TestApplicationGo):
|
||||
def setUpClass():
|
||||
TestApplicationGo().check_modules('go')
|
||||
prerequisites = ['go']
|
||||
|
||||
def test_go_application_variables(self):
|
||||
self.load('variables')
|
||||
|
||||
@@ -2,8 +2,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestHTTPHeader(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def test_http_header_value_leading_sp(self):
|
||||
self.load('custom_header')
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.applications.lang.java import TestApplicationJava
|
||||
|
||||
|
||||
class TestJavaApplication(TestApplicationJava):
|
||||
def setUpClass():
|
||||
TestApplicationJava().check_modules('java')
|
||||
prerequisites = ['java']
|
||||
|
||||
def test_java_application_cookies(self):
|
||||
self.load('cookies')
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.applications.lang.node import TestApplicationNode
|
||||
|
||||
|
||||
class TestNodeApplication(TestApplicationNode):
|
||||
def setUpClass():
|
||||
TestApplicationNode().check_modules('node')
|
||||
prerequisites = ['node']
|
||||
|
||||
def test_node_application_basic(self):
|
||||
self.load('basic')
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.applications.lang.perl import TestApplicationPerl
|
||||
|
||||
|
||||
class TestPerlApplication(TestApplicationPerl):
|
||||
def setUpClass():
|
||||
TestApplicationPerl().check_modules('perl')
|
||||
prerequisites = ['perl']
|
||||
|
||||
def test_perl_application(self):
|
||||
self.load('variables')
|
||||
|
||||
@@ -3,8 +3,7 @@ import unittest
|
||||
from unit.applications.lang.php import TestApplicationPHP
|
||||
|
||||
class TestPHPApplication(TestApplicationPHP):
|
||||
def setUpClass():
|
||||
TestApplicationPHP().check_modules('php')
|
||||
prerequisites = ['php']
|
||||
|
||||
def before_disable_functions(self):
|
||||
body = self.get()['body']
|
||||
|
||||
@@ -2,8 +2,7 @@ from unit.control import TestControl
|
||||
|
||||
|
||||
class TestPHPBasic(TestControl):
|
||||
def setUpClass():
|
||||
TestControl().check_modules('php')
|
||||
prerequisites = ['php']
|
||||
|
||||
conf_app = {
|
||||
"app": {
|
||||
|
||||
@@ -4,8 +4,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestPythonApplication(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def test_python_application_variables(self):
|
||||
self.load('variables')
|
||||
|
||||
@@ -2,8 +2,7 @@ from unit.control import TestControl
|
||||
|
||||
|
||||
class TestPythonBasic(TestControl):
|
||||
def setUpClass():
|
||||
TestControl().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
conf_app = {
|
||||
"app": {
|
||||
|
||||
@@ -2,8 +2,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestPythonEnvironment(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def test_python_environment_name_null(self):
|
||||
self.load('environment')
|
||||
|
||||
@@ -6,8 +6,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestPythonProcman(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def pids_for_process(self):
|
||||
time.sleep(0.2)
|
||||
|
||||
@@ -2,8 +2,7 @@ from unit.applications.proto import TestApplicationProto
|
||||
|
||||
|
||||
class TestRouting(TestApplicationProto):
|
||||
def setUpClass():
|
||||
TestApplicationProto().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
@@ -3,8 +3,7 @@ from unit.applications.lang.ruby import TestApplicationRuby
|
||||
|
||||
|
||||
class TestRubyApplication(TestApplicationRuby):
|
||||
def setUpClass():
|
||||
TestApplicationRuby().check_modules('ruby')
|
||||
prerequisites = ['ruby']
|
||||
|
||||
def test_ruby_application(self):
|
||||
self.load('variables')
|
||||
|
||||
@@ -5,8 +5,7 @@ from unit.applications.lang.python import TestApplicationPython
|
||||
|
||||
|
||||
class TestSettings(TestApplicationPython):
|
||||
def setUpClass():
|
||||
TestApplicationPython().check_modules('python')
|
||||
prerequisites = ['python']
|
||||
|
||||
def test_settings_header_read_timeout(self):
|
||||
self.load('empty')
|
||||
|
||||
@@ -4,12 +4,10 @@ import time
|
||||
import subprocess
|
||||
import unittest
|
||||
from unit.applications.tls import TestApplicationTLS
|
||||
from unit.main import TestUnit
|
||||
|
||||
|
||||
class TestTLS(TestApplicationTLS):
|
||||
def setUpClass():
|
||||
TestUnit().check_modules('python', 'openssl')
|
||||
prerequisites = ['python', 'openssl']
|
||||
|
||||
def findall(self, pattern):
|
||||
with open(self.testdir + '/unit.log', 'r', errors='ignore') as f:
|
||||
|
||||
@@ -47,6 +47,10 @@ class TestUnit(unittest.TestCase):
|
||||
|
||||
unittest.main()
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
TestUnit().check_modules(*cls.prerequisites)
|
||||
|
||||
def setUp(self):
|
||||
self._run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user