rename to main
This commit is contained in:
parent
4b6da547b8
commit
2e3e92c538
1 changed files with 0 additions and 0 deletions
|
|
@ -1,36 +0,0 @@
|
|||
from pathlib import Path
|
||||
from typing import Protocol
|
||||
|
||||
from dotenv import dotenv_values
|
||||
from icecream import ic
|
||||
from tests_wordpress.runner_wordpress import RunnerWordpress
|
||||
|
||||
|
||||
class TestRunner(Protocol):
|
||||
def __init__(self, dotenv_path: Path):
|
||||
...
|
||||
|
||||
def run_tests(self):
|
||||
...
|
||||
|
||||
|
||||
RUNNER_DICT: dict[str, type[TestRunner]] = {"wordpress": RunnerWordpress}
|
||||
|
||||
|
||||
class Wrapper:
|
||||
def __init__(self, dotenv_path: Path):
|
||||
assert dotenv_path.is_file()
|
||||
config: dict[str, str] = dotenv_values(dotenv_path)
|
||||
runner = self.load_runner(config, dotenv_path)
|
||||
runner.run_tests()
|
||||
|
||||
def load_runner(self, config: dict[str, str], dotenv_path: Path) -> TestRunner:
|
||||
config_type = config["TYPE"]
|
||||
ic(config_type)
|
||||
RunnerClass = RUNNER_DICT[config_type]
|
||||
return RunnerClass(dotenv_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
dotenv_path = Path(__file__).parent / "./blog.dev.local-it.cloud.env"
|
||||
t = Wrapper(dotenv_path)
|
||||
Loading…
Add table
Add a link
Reference in a new issue