(self)
| 67 | self.assertEqual(self.ground.readbytes(p), data) |
| 68 | |
| 69 | def test_write_text(self): |
| 70 | p = self.root / 'fileA' |
| 71 | data = 'äbcdefg' |
| 72 | self.assertEqual(len(data), p.write_text(data, encoding='latin-1')) |
| 73 | self.assertEqual(self.ground.readbytes(p), b'\xe4bcdefg') |
| 74 | # Check that trying to write bytes does not truncate the file. |
| 75 | self.assertRaises(TypeError, p.write_text, b'somebytes', encoding='utf-8') |
| 76 | self.assertEqual(self.ground.readbytes(p), b'\xe4bcdefg') |
| 77 | |
| 78 | @unittest.skipIf( |
| 79 | not getattr(sys.flags, 'warn_default_encoding', 0), |
nothing calls this directly
no test coverage detected