feat: release v1.1.0 - clean YAML, wildcard DNS protection, and tag/group/source filtering
Build and Publish Release / Build Packages and Publish (push) Successful in 9s
Build and Publish Release / Build Packages and Publish (push) Successful in 9s
This commit is contained in:
1 parent
5fedc44c6b
commit
598e5d7397
18 files changed
+318
-22
No files matched your search
@@ -47,5 +47,21 @@ destinations:
|
||||
finally:
|
||||
cfg_path.unlink()
|
||||
|
||||
def test_load_env_files(self):
|
||||
with NamedTemporaryFile("w+", suffix=".env", delete=False) as f:
|
||||
f.write("TEST_ENV_VAR_COLLECTOR=dynamic_val\nexport TEST_ANOTHER=exported_val\n")
|
||||
env_file = Path(f.name)
|
||||
|
||||
try:
|
||||
# Test direct parsing through _load_env_files candidate injection
|
||||
with unittest.mock.patch("inventory_collector.config.Path.is_file") as mock_is_file, \
|
||||
unittest.mock.patch("inventory_collector.config.Path.read_text") as mock_read:
|
||||
mock_is_file.return_value = True
|
||||
mock_read.return_value = "TEST_AUTO_LOADED_KEY=success_val\n"
|
||||
ConfigLoader._load_env_files()
|
||||
self.assertEqual(os.environ.get("TEST_AUTO_LOADED_KEY"), "success_val")
|
||||
finally:
|
||||
env_file.unlink()
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user