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

Method test_stateless

Lib/test/test_multibytecodec.py:82–93  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80class Test_IncrementalEncoder(unittest.TestCase):
81
82 def test_stateless(self):
83 # cp949 encoder isn't stateful at all.
84 encoder = codecs.getincrementalencoder('cp949')()
85 self.assertEqual(encoder.encode('\ud30c\uc774\uc36c \ub9c8\uc744'),
86 b'\xc6\xc4\xc0\xcc\xbd\xe3 \xb8\xb6\xc0\xbb')
87 self.assertEqual(encoder.reset(), None)
88 self.assertEqual(encoder.encode('\u2606\u223c\u2606', True),
89 b'\xa1\xd9\xa1\xad\xa1\xd9')
90 self.assertEqual(encoder.reset(), None)
91 self.assertEqual(encoder.encode('', True), b'')
92 self.assertEqual(encoder.encode('', False), b'')
93 self.assertEqual(encoder.reset(), None)
94
95 def test_stateful(self):
96 # jisx0213 encoder is stateful for a few code points. eg)

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
encodeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected