(self)
| 487 | self.assertEqual(fi.filename(), os.fspath(t1)) |
| 488 | |
| 489 | def test_pathlike_file_inplace(self): |
| 490 | t1 = FakePath(self.writeTmp('Path-like file.')) |
| 491 | with FileInput(t1, inplace=True, encoding="utf-8") as fi: |
| 492 | line = fi.readline() |
| 493 | self.assertEqual(line, 'Path-like file.') |
| 494 | print('Modified %s' % line) |
| 495 | with open(t1, encoding="utf-8") as f: |
| 496 | self.assertEqual(f.read(), 'Modified Path-like file.\n') |
| 497 | |
| 498 | |
| 499 | class MockFileInput: |