add Runner class, test infrastructure

This commit is contained in:
Daniel 2023-11-21 21:34:06 +01:00
parent 85200a6322
commit 2d9ca21fec
3 changed files with 92 additions and 50 deletions

View file

@ -3,7 +3,7 @@ from typing import Protocol
from dotenv import dotenv_values
from icecream import ic
from tests_wordpress.testrunner_wordpress import TestRunnerWordpress
from tests_wordpress.runner_wordpress import RunnerWordpress
class TestRunner(Protocol):
@ -11,7 +11,7 @@ class TestRunner(Protocol):
pass
WRAPPER_DICT: dict[str, type[TestRunner]] = {"wordpress": TestRunnerWordpress}
RUNNER_DICT: dict[str, type[TestRunner]] = {"wordpress": RunnerWordpress}
class TestWrapper:
@ -32,9 +32,9 @@ class TestWrapper:
def load_test_wrapper(self):
config_type = self.config["TYPE"]
ic(config_type)
WrapperClass = WRAPPER_DICT[config_type]
wrapper = WrapperClass(self.dotenv_path)
wrapper.run_tests()
RunnerClass = RUNNER_DICT[config_type]
runner = RunnerClass(self.dotenv_path)
runner.run_tests()
if __name__ == "__main__":