MCPcopy
hub / github.com/modelscope/ms-swift / test_jsonl

Method test_jsonl

tests/utils/test_io_utils.py:22–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20 shutil.rmtree(self.tmp_dir)
21
22 def test_jsonl(self):
23 fpath = os.path.join(self.tmp_dir, '1.jsonl')
24 obj_list = [{'aaa': 'bbb'}, 111, [1.1]]
25 write_to_jsonl(fpath, obj_list)
26 new_obj = {'bbb': 'aaa'}
27 obj_list.append(new_obj)
28 append_to_jsonl(fpath, new_obj)
29 new_obj_list = read_from_jsonl(fpath)
30 self.assertTrue(new_obj_list == obj_list)
31
32 def test_jsonl2(self):
33 fpath = os.path.join(self.tmp_dir, '1.jsonl')

Callers

nothing calls this directly

Calls 4

write_to_jsonlFunction · 0.90
append_to_jsonlFunction · 0.90
read_from_jsonlFunction · 0.90
appendMethod · 0.80

Tested by

no test coverage detected