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

Method test_seeking_read

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

Source from the content-addressed store, hash-verified

3685 self.assertEqual(bio.getvalue(), text.encode('utf-8'))
3686
3687 def test_seeking_read(self):
3688 bio = io.BytesIO('line1\nline2\nline3\n'.encode('utf-16-le'))
3689 sr = codecs.EncodedFile(bio, 'utf-8', 'utf-16-le')
3690
3691 self.assertEqual(sr.readline(), b'line1\n')
3692 sr.seek(0)
3693 self.assertEqual(sr.readline(), b'line1\n')
3694 self.assertEqual(sr.readline(), b'line2\n')
3695 self.assertEqual(sr.readline(), b'line3\n')
3696 self.assertEqual(sr.readline(), b'')
3697
3698 def test_seeking_write(self):
3699 bio = io.BytesIO('123456789\n'.encode('utf-16-le'))

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.45
assertEqualMethod · 0.45
readlineMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected