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