2022-01-24 11:40:02 +00:00
|
|
|
from typing import Dict
|
2018-08-10 10:09:19 +00:00
|
|
|
|
|
|
|
|
2018-04-28 09:02:39 +00:00
|
|
|
class SingleTestData(object):
|
2021-11-11 11:40:31 +00:00
|
|
|
def __init__(self, name, testruns, testrail_case_id, geth_paths):
|
2018-04-28 09:02:39 +00:00
|
|
|
self.testrail_case_id = testrail_case_id
|
|
|
|
self.name = name
|
|
|
|
self.testruns = testruns
|
2021-11-11 11:40:31 +00:00
|
|
|
self.geth_paths = geth_paths
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
class TestRunData(object):
|
2022-01-24 11:40:02 +00:00
|
|
|
def __init__(self, steps, jobs, error, first_commands: Dict[str, int]):
|
2018-04-28 09:02:39 +00:00
|
|
|
self.steps = steps
|
|
|
|
self.jobs = jobs
|
|
|
|
self.error = error
|
2022-01-24 11:40:02 +00:00
|
|
|
self.first_commands = first_commands
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
def create_new_testrun(self):
|
2022-01-24 11:40:02 +00:00
|
|
|
self.testruns.append(SingleTestData.TestRunData(list(), dict(), None, dict()))
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestSuiteData(object):
|
|
|
|
def __init__(self):
|
|
|
|
self.apk_name = None
|
|
|
|
self.current_test = None
|
|
|
|
self.tests = list()
|
|
|
|
|
|
|
|
def set_current_test(self, test_name, testrail_case_id):
|
|
|
|
existing_test = next((test for test in self.tests if test.name == test_name), None)
|
|
|
|
if existing_test:
|
|
|
|
self.current_test = existing_test
|
|
|
|
else:
|
2021-11-11 11:40:31 +00:00
|
|
|
test = SingleTestData(test_name, list(), testrail_case_id, list())
|
2018-04-28 09:02:39 +00:00
|
|
|
self.tests.append(test)
|
2022-01-24 11:40:02 +00:00
|
|
|
self.current_test = test
|