new test framework #1

Merged
dan merged 47 commits from wip-new-framework into dev 2023-11-22 21:40:14 +01:00
Showing only changes of commit 534eb229c9 - Show all commits

View file

@ -17,24 +17,19 @@ RUNNER_DICT: dict[str, type[TestRunner]] = {"wordpress": RunnerWordpress}
class TestWrapper:
def __init__(self, dotenv_path: Path):
self.dotenv_path = dotenv_path
self.root_dir = self.dotenv_path.parent
self.show_files()
self.load_dotenv()
self.load_test_wrapper()
self.config = self.load_config_from_dotenv(dotenv_path)
runner = self.load_runner()
runner.run_tests()
def show_files(self):
ic(list(self.root_dir.glob("*")))
def load_config_from_dotenv(self, dotenv_path: Path):
assert dotenv_path.is_file()
return dotenv_values(self.dotenv_path)
def load_dotenv(self):
assert self.dotenv_path.is_file()
self.config = dotenv_values(self.dotenv_path)
def load_test_wrapper(self):
def load_runner(self):
config_type = self.config["TYPE"]
ic(config_type)
RunnerClass = RUNNER_DICT[config_type]
runner = RunnerClass(self.dotenv_path)
runner.run_tests()
return RunnerClass(self.dotenv_path)
if __name__ == "__main__":