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

Method test_seek

Lib/test/test_codecs.py:2279–2292  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2277
2278 @unittest.expectedFailure # TODO: RUSTPYTHON; LookupError: unknown encoding: big5
2279 def test_seek(self):
2280 # all codecs should be able to encode these
2281 s = "%s\n%s\n" % (100*"abc123", 100*"def456")
2282 for encoding in all_unicode_encodings:
2283 if encoding == "idna": # FIXME: See SF bug #1163178
2284 continue
2285 if encoding in broken_unicode_with_stateful:
2286 continue
2287 reader = codecs.getreader(encoding)(io.BytesIO(s.encode(encoding)))
2288 for t in range(5):
2289 # Test that calling seek resets the internal codec state and buffers
2290 reader.seek(0, 0)
2291 data = reader.read()
2292 self.assertEqual(s, data)
2293
2294 @unittest.expectedFailure # TODO: RUSTPYTHON; LookupError: unknown encoding: big5
2295 def test_bad_decode_args(self):

Callers

nothing calls this directly

Calls 5

getreaderMethod · 0.80
encodeMethod · 0.45
seekMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected