MCPcopy Create free account
hub / github.com/dbcli/mycli / test_create_and_write_default_config

Function test_create_and_write_default_config

test/pytests/test_config.py:208–222  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

206
207
208def test_create_and_write_default_config(tmp_path) -> None:
209 default_config = create_default_config()
210 assert 'main' in default_config
211
212 destination = tmp_path / 'myclirc'
213 write_default_config(str(destination))
214 written = destination.read_text(encoding='utf8')
215 assert '[main]' in written
216
217 destination.write_text('custom', encoding='utf8')
218 write_default_config(str(destination))
219 assert destination.read_text(encoding='utf8') == 'custom'
220
221 write_default_config(str(destination), overwrite=True)
222 assert '[main]' in destination.read_text(encoding='utf8')
223
224
225def test_get_mylogin_cnf_path_returns_none_for_missing_file(monkeypatch, tmp_path) -> None:

Callers

nothing calls this directly

Calls 2

create_default_configFunction · 0.90
write_default_configFunction · 0.90

Tested by

no test coverage detected