![]() |
ThalamOS
a powerful Flask web application designed to enhance your storage management.
|
Functions | |
Annotated[dict, "dictionary of environment variables"] | get_env_variables_from_path (str env_path) |
Annotated[dict, "dictionary of environment variables"] | get_env () |
test_get_env_variables_from_path (tmp_path) | |
test_get_env_variables_from_path_empty_file (tmp_path) | |
test_get_env_variables_from_path_invalid_format (tmp_path) | |
This module provides functionality to read and load environment variables from a .env file. Functions: get_env_variables(env_path: str) -> dict: get_env() -> dict: Loads environment variables from a .env file and returns them as a dictionary.
Annotated[dict, "dictionary of environment variables"] config_manager.get_env | ( | ) |
Loads environment variables from a .env file and returns them as a dictionary. Returns: dict: A dictionary containing the environment variables.
Definition at line 34 of file config_manager.py.
Annotated[dict, "dictionary of environment variables"] config_manager.get_env_variables_from_path | ( | str | env_path | ) |
Reads environment variables from a file and returns them as a dictionary. Args: env_path (str): The path to the environment variables file. Returns: dict: A dictionary containing the environment variables as key-value pairs.
Definition at line 17 of file config_manager.py.
config_manager.test_get_env_variables_from_path | ( | tmp_path | ) |
Test the get_env_variables_from_path function. This test creates a temporary .env file with predefined key-value pairs, calls the get_env_variables_from_path function with the path to the temporary .env file, and asserts that the returned dictionary contains the expected key-value pairs. Args: tmp_path (pathlib.Path): A temporary directory path provided by pytest. Raises: AssertionError: If the returned dictionary does not match the expected key-value pairs.
Definition at line 54 of file config_manager.py.
config_manager.test_get_env_variables_from_path_empty_file | ( | tmp_path | ) |
Test case for get_env_variables_from_path function with an empty .env file. This test creates an empty temporary .env file and calls the get_env_variables_from_path function with the path to this file. It then asserts that the returned dictionary is empty. Args: tmp_path (pathlib.Path): A temporary directory path provided by pytest.
Definition at line 78 of file config_manager.py.
config_manager.test_get_env_variables_from_path_invalid_format | ( | tmp_path | ) |
Test case for get_env_variables_from_path function to handle invalid format in .env file. This test creates a temporary .env file with an invalid format and verifies that the get_env_variables_from_path function raises an IndexError when attempting to parse it. Args: tmp_path (pathlib.Path): Temporary directory provided by pytest to create the .env file. Raises: IndexError: Expected exception when the .env file contains an invalid format.
Definition at line 99 of file config_manager.py.