Tests: improving get_application_type() and fixing its name.

This patch also enables multiversion tests running for Java.
This commit is contained in:
Max Romanov
2020-10-28 00:01:46 +03:00
parent f007ad4dcf
commit 6a00bab41e
7 changed files with 14 additions and 28 deletions

View File

@@ -7,6 +7,8 @@ from unit.control import TestControl
class TestApplicationProto(TestControl):
application_type = None
def sec_epoch(self):
return time.mktime(time.gmtime())
@@ -28,15 +30,12 @@ class TestApplicationProto(TestControl):
return found
def get_appication_type(self):
def get_application_type(self):
current_test = (
os.environ.get('PYTEST_CURRENT_TEST').split(':')[-1].split(' ')[0]
)
if current_test in option.generated_tests:
return option.generated_tests[current_test]
return None
return option.generated_tests.get(current_test, self.application_type)
def _load_conf(self, conf, **kwargs):
if 'applications' in conf: