summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications/proto.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/unit/applications/proto.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py
index 2f748c21..6e760c70 100644
--- a/test/unit/applications/proto.py
+++ b/test/unit/applications/proto.py
@@ -7,6 +7,8 @@ from unit.control import TestControl
class TestApplicationProto(TestControl):
+ application_type = None
+
def sec_epoch(self):
return time.mktime(time.gmtime())
@@ -14,7 +16,7 @@ class TestApplicationProto(TestControl):
return time.mktime(time.strptime(date, template))
def search_in_log(self, pattern, name='unit.log'):
- with open(self.temp_dir + '/' + name, 'r', errors='ignore') as f:
+ with open(option.temp_dir + '/' + name, 'r', errors='ignore') as f:
return re.search(pattern, f.read())
def wait_for_record(self, pattern, name='unit.log'):
@@ -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: