Fixed linter and test for config file

This commit is contained in:
TheNetworkGuy 2025-06-12 11:14:15 +00:00
parent c8fda04ce8
commit 3115eaa04e
2 changed files with 3 additions and 4 deletions

View File

@ -118,4 +118,4 @@ def load_config_file(config_default, config_file="config.py"):
if hasattr(config_module, key):
dconf[key] = getattr(config_module, key)
return dconf
return config_default
return config_default

View File

@ -93,11 +93,10 @@ def test_load_config_file_function():
def test_load_config_file_not_found():
"""Test load_config_file when the config file doesn't exist"""
# Instead of trying to assert on the logger call, we'll just check the return value
# and verify the function works as expected in this case
with patch('pathlib.Path.exists', return_value=False):
result = load_config_file(DEFAULT_CONFIG.copy())
assert result is None
# Should return a dict equal to DEFAULT_CONFIG, not a new object
assert result == DEFAULT_CONFIG
def test_load_env_variable_function():