MCPcopy Index your code
hub / github.com/python/cpython / test_callback_forward_index

Method test_callback_forward_index

Lib/test/multibytecodec_support.py:159–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157 (b'abcdREPLACEDabcdREPLACEDabcdREPLACEDabcdTERMINALefgh', 9))
158
159 def test_callback_forward_index(self):
160 def myreplace(exc):
161 return ('REPLACED', exc.end + 2)
162 codecs.register_error("test.cjktest", myreplace)
163 self.assertEqual(self.encode('abcd' + self.unmappedunicode + 'efgh',
164 'test.cjktest'), (b'abcdREPLACEDgh', 9))
165
166 def test_callback_index_outofbound(self):
167 def myreplace(exc):

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected