(self)
| 1179 | self.open, self.filename, "rb", newline="\n") |
| 1180 | |
| 1181 | def test_encoding(self): |
| 1182 | # Test non-default encoding. |
| 1183 | text = self.TEXT.decode("ascii") |
| 1184 | text_native_eol = text.replace("\n", os.linesep) |
| 1185 | with self.open(self.filename, "wt", encoding="utf-16-le") as f: |
| 1186 | f.write(text) |
| 1187 | with open(self.filename, "rb") as f: |
| 1188 | file_data = ext_decompress(f.read()).decode("utf-16-le") |
| 1189 | self.assertEqual(file_data, text_native_eol) |
| 1190 | with self.open(self.filename, "rt", encoding="utf-16-le") as f: |
| 1191 | self.assertEqual(f.read(), text) |
| 1192 | |
| 1193 | def test_encoding_error_handler(self): |
| 1194 | # Test with non-default encoding error handler. |
nothing calls this directly
no test coverage detected