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

Method testRead

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

Source from the content-addressed store, hash-verified

367 self.assertEqual("", f.readline())
368
369 def testRead(self):
370 file_path = os.path.join(self._base_dir, "temp_file")
371 with file_io.FileIO(file_path, mode="r+") as f:
372 f.write("testing1\ntesting2\ntesting3\n\ntesting5")
373 self.assertEqual(36, f.size())
374 self.assertEqual("testing1\n", f.read(9))
375 self.assertEqual("testing2\n", f.read(9))
376 self.assertEqual("t", f.read(1))
377 self.assertEqual("esting3\n\ntesting5", f.read())
378
379 def testTell(self):
380 file_path = os.path.join(self._base_dir, "temp_file")

Callers

nothing calls this directly

Calls 4

joinMethod · 0.45
writeMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected