MCPcopy Create free account
hub / github.com/PAIR-code/lit / test_write_roundtrip

Method test_write_roundtrip

lit_nlp/api/dataset_test.py:598–607  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

596 self.assertEqual(original[key], loaded[key])
597
598 def test_write_roundtrip(self):
599 tempdir = self.create_tempdir()
600 output_base = os.path.join(tempdir.full_path, 'test_dataset.lit.jsonl')
601 lit_dataset.write_examples(self.sample_examples, output_base)
602 lit_dataset.write_spec(self.data_spec, output_base + '.spec')
603
604 # Read back and compare contents
605 ds = lit_dataset.load_lit_format(output_base)
606 self.assertEqual(self.data_spec, ds.spec())
607 self.assertEqual(self.sample_examples, ds.examples)
608
609 def test_write_roundtrip_indexed(self):
610 tempdir = self.create_tempdir()

Callers

nothing calls this directly

Calls 1

specMethod · 0.45

Tested by

no test coverage detected