MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testReadLine

Method testReadLine

tensorflow/python/lib/io/file_io_test.py:357–367  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

355 self.assertFalse(file_statistics.is_directory)
356
357 def testReadLine(self):
358 file_path = os.path.join(self._base_dir, "temp_file")
359 with file_io.FileIO(file_path, mode="r+") as f:
360 f.write("testing1\ntesting2\ntesting3\n\ntesting5")
361 self.assertEqual(36, f.size())
362 self.assertEqual("testing1\n", f.readline())
363 self.assertEqual("testing2\n", f.readline())
364 self.assertEqual("testing3\n", f.readline())
365 self.assertEqual("\n", f.readline())
366 self.assertEqual("testing5", f.readline())
367 self.assertEqual("", f.readline())
368
369 def testRead(self):
370 file_path = os.path.join(self._base_dir, "temp_file")

Callers

nothing calls this directly

Calls 4

readlineMethod · 0.80
joinMethod · 0.45
writeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected