diff --git a/src/monitor_utils/config.py b/src/monitor_utils/config.py index 450ae4e..ac380d6 100644 --- a/src/monitor_utils/config.py +++ b/src/monitor_utils/config.py @@ -27,14 +27,14 @@ def get_bot_token(is_production: bool) -> str: def get_config( - monitor_name: str, use_production_path: bool = False + monitor_name: str, + config_dir: str | pathlib.Path = "configs", + test_config_dir: str | pathlib.Path = "tests/configs", + use_production_path: bool = False, ) -> tuple[dict, pathlib.Path]: monitor_name = monitor_name.replace(".json", "") - if use_production_path: - config_path = PROJECT_ROOT / "configs" / f"{monitor_name}.json" - else: - config_path = PROJECT_ROOT / "tests" / "configs" / f"{monitor_name}.json" - + base = config_dir if use_production_path else test_config_dir + config_path = pathlib.Path(base) / f"{monitor_name}.json" with open(config_path) as f: return json.load(f), config_path