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