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

Method test_save_jsonl

tests/datasets/test_formatters.py:232–240  ·  view source on GitHub ↗

Test saving data to JSONL file.

(self, jsonl_format, temp_dir, sample_data_list)

Source from the content-addressed store, hash-verified

230 assert data[0] == {"valid": True}
231
232 def test_save_jsonl(self, jsonl_format, temp_dir, sample_data_list):
233 """Test saving data to JSONL file."""
234 filepath = os.path.join(temp_dir, "output.jsonl")
235 jsonl_format.save(sample_data_list, filepath)
236
237 assert os.path.exists(filepath)
238 with open(filepath, "r", encoding="utf-8") as f:
239 lines = f.readlines()
240 assert len(lines) == len(sample_data_list)
241
242 def test_save_jsonl_each_line_valid_json(
243 self, jsonl_format, temp_dir, sample_data_list

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected