MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_encoding_error_handler

Method test_encoding_error_handler

Lib/test/test_bz2.py:1184–1190  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1182 self.assertEqual(f.read(), text)
1183
1184 def test_encoding_error_handler(self):
1185 # Test with non-default encoding error handler.
1186 with self.open(self.filename, "wb") as f:
1187 f.write(b"foo\xffbar")
1188 with self.open(self.filename, "rt", encoding="ascii", errors="ignore") \
1189 as f:
1190 self.assertEqual(f.read(), "foobar")
1191
1192 def test_newline(self):
1193 # Test with explicit newline (universal newline mode disabled).

Callers

nothing calls this directly

Calls 4

openMethod · 0.95
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected