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

Method test_callback_long_index

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

Source from the content-addressed store, hash-verified

124 'test.cjktest')
125
126 def test_callback_long_index(self):
127 def myreplace(exc):
128 return ('x', int(exc.end))
129 codecs.register_error("test.cjktest", myreplace)
130 self.assertEqual(self.encode('abcd' + self.unmappedunicode + 'efgh',
131 'test.cjktest'), (b'abcdxefgh', 9))
132
133 def myreplace(exc):
134 return ('x', sys.maxsize + 1)
135 codecs.register_error("test.cjktest", myreplace)
136 self.assertRaises(IndexError, self.encode, self.unmappedunicode,
137 'test.cjktest')
138
139 def test_callback_None_index(self):
140 def myreplace(exc):

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
encodeMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected