(self)
| 1170 | self.open, self.filename, "rb", newline="\n") |
| 1171 | |
| 1172 | def test_encoding(self): |
| 1173 | # Test non-default encoding. |
| 1174 | text = self.TEXT.decode("ascii") |
| 1175 | text_native_eol = text.replace("\n", os.linesep) |
| 1176 | with self.open(self.filename, "wt", encoding="utf-16-le") as f: |
| 1177 | f.write(text) |
| 1178 | with open(self.filename, "rb") as f: |
| 1179 | file_data = ext_decompress(f.read()).decode("utf-16-le") |
| 1180 | self.assertEqual(file_data, text_native_eol) |
| 1181 | with self.open(self.filename, "rt", encoding="utf-16-le") as f: |
| 1182 | self.assertEqual(f.read(), text) |
| 1183 | |
| 1184 | def test_encoding_error_handler(self): |
| 1185 | # Test with non-default encoding error handler. |
nothing calls this directly
no test coverage detected