MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / test_init_cfg_py

Method test_init_cfg_py

tests/utils/test_config.py:174–182  ·  view source on GitHub ↗

Test init_cfg with Python file.

(self, temp_dir)

Source from the content-addressed store, hash-verified

172 """Tests for init_cfg function."""
173
174 def test_init_cfg_py(self, temp_dir):
175 """Test init_cfg with Python file."""
176 config_path = os.path.join(temp_dir, "config.py")
177 with open(config_path, "w") as f:
178 f.write("test_key = 'test_value'\n")
179
180 init_cfg(config_path)
181 cfg = get_cfg()
182 assert cfg.test_key == "test_value"
183
184 def test_init_cfg_nonexistent(self, temp_dir):
185 """Test init_cfg with nonexistent file."""

Callers

nothing calls this directly

Calls 2

init_cfgFunction · 0.90
get_cfgFunction · 0.90

Tested by

no test coverage detected