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

Method test_callback_backward_index

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

Source from the content-addressed store, hash-verified

144 'test.cjktest')
145
146 def test_callback_backward_index(self):
147 def myreplace(exc):
148 if myreplace.limit > 0:
149 myreplace.limit -= 1
150 return ('REPLACED', 0)
151 else:
152 return ('TERMINAL', exc.end)
153 myreplace.limit = 3
154 codecs.register_error("test.cjktest", myreplace)
155 self.assertEqual(self.encode('abcd' + self.unmappedunicode + 'efgh',
156 'test.cjktest'),
157 (b'abcdREPLACEDabcdREPLACEDabcdREPLACEDabcdTERMINALefgh', 9))
158
159 def test_callback_forward_index(self):
160 def myreplace(exc):

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected