MCPcopy Index your code
hub / github.com/github/spec-kit / test_merge_json_files_unparseable_existing

Function test_merge_json_files_unparseable_existing

tests/test_merge.py:120–125  ·  view source on GitHub ↗

If the existing file is unparseable JSON, return None to avoid overwriting it.

(tmp_path)

Source from the content-addressed store, hash-verified

118 assert merge_json_files(existing_file, ["not", "a", "dict"]) is None
119
120def test_merge_json_files_unparseable_existing(tmp_path):
121 """If the existing file is unparseable JSON, return None to avoid overwriting it."""
122 bad_file = tmp_path / "bad.json"
123 bad_file.write_text('{"a": 1, missing_value}') # Invalid JSON
124
125 assert merge_json_files(bad_file, {"b": 2}) is None
126
127
128def test_merge_json_files_list_preservation(tmp_path):

Callers

nothing calls this directly

Calls 1

merge_json_filesFunction · 0.90

Tested by

no test coverage detected