add get_config
This commit is contained in:
parent
0e9d0e0334
commit
ef0d9c9415
1 changed files with 7 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from dotenv import dotenv_values
|
||||||
|
|
||||||
|
|
||||||
class DirManager:
|
class DirManager:
|
||||||
"""Manages directories for the tests and should be used to create and find
|
"""Manages directories for the tests and should be used to create and find
|
||||||
|
|
@ -69,3 +71,8 @@ class DirManager:
|
||||||
@property
|
@property
|
||||||
def RECIPES(self):
|
def RECIPES(self):
|
||||||
return self.recipes_dir
|
return self.recipes_dir
|
||||||
|
|
||||||
|
def get_config(self, search_string: str) -> dict[str, str]:
|
||||||
|
env_file = next(self.ENV_FILES.glob(f"*{search_string}*"))
|
||||||
|
config: dict[str, str] = dotenv_values(env_file) # type: ignore
|
||||||
|
return config
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue