(self)
| 58 | self.assertRaises(ValueError, magic_open, p, 'wb', newline='') |
| 59 | |
| 60 | def test_write_bytes(self): |
| 61 | p = self.root / 'fileA' |
| 62 | data = b'abcdefg' |
| 63 | self.assertEqual(len(data), p.write_bytes(data)) |
| 64 | self.assertEqual(self.ground.readbytes(p), data) |
| 65 | # Check that trying to write str does not truncate the file. |
| 66 | self.assertRaises(TypeError, p.write_bytes, 'somestr') |
| 67 | self.assertEqual(self.ground.readbytes(p), data) |
| 68 | |
| 69 | def test_write_text(self): |
| 70 | p = self.root / 'fileA' |
nothing calls this directly
no test coverage detected