If the existing file is unparseable JSON, return None to avoid overwriting it.
(tmp_path)
| 118 | assert merge_json_files(existing_file, ["not", "a", "dict"]) is None |
| 119 | |
| 120 | def 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 | |
| 128 | def test_merge_json_files_list_preservation(tmp_path): |
nothing calls this directly
no test coverage detected