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

Method test_seeking_write

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

Source from the content-addressed store, hash-verified

3696 self.assertEqual(sr.readline(), b'')
3697
3698 def test_seeking_write(self):
3699 bio = io.BytesIO('123456789\n'.encode('utf-16-le'))
3700 sr = codecs.EncodedFile(bio, 'utf-8', 'utf-16-le')
3701
3702 # Test that seek() only resets its internal buffer when offset
3703 # and whence are zero.
3704 sr.seek(2)
3705 sr.write(b'\nabc\n')
3706 self.assertEqual(sr.readline(), b'789\n')
3707 sr.seek(0)
3708 self.assertEqual(sr.readline(), b'1\n')
3709 self.assertEqual(sr.readline(), b'abc\n')
3710 self.assertEqual(sr.readline(), b'789\n')
3711
3712 def test_copy(self):
3713 bio = io.BytesIO()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected