mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-13 07:24:47 -06:00
Fixed linter and test for config file
This commit is contained in:
parent
c8fda04ce8
commit
3115eaa04e
@ -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
|
||||
|
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user