Test that reading past EOF does not raise an exception.
(self)
| 478 | self.assertEqual(b"testing", f.read()) |
| 479 | |
| 480 | def testEof(self): |
| 481 | """Test that reading past EOF does not raise an exception.""" |
| 482 | |
| 483 | file_path = os.path.join(self._base_dir, "temp_file") |
| 484 | f = file_io.FileIO(file_path, mode="r+") |
| 485 | content = "testing" |
| 486 | f.write(content) |
| 487 | f.flush() |
| 488 | self.assertEqual(content, f.read(len(content) + 1)) |
| 489 | |
| 490 | def testUTF8StringPathExists(self): |
| 491 | file_path = os.path.join(self._base_dir, "UTF8测试_file_exist") |