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

Function test_04

extra_tests/snippets/stdlib_io_bytesio.py:36–48  ·  view source on GitHub ↗

Tests that the read method increments the cursor position and the seek method moves the cursor to the appropriate position

()

Source from the content-addressed store, hash-verified

34
35
36def test_04():
37 """
38 Tests that the read method increments the
39 cursor position and the seek method moves
40 the cursor to the appropriate position
41 """
42 string = b"Test String 4"
43 f = BytesIO(string)
44
45 assert f.read(4) == b"Test"
46 assert f.tell() == 4
47 assert f.seek(0) == 0
48 assert f.read(4) == b"Test"
49
50
51def test_05():

Callers 1

Calls 4

readMethod · 0.95
tellMethod · 0.95
seekMethod · 0.95
BytesIOClass · 0.90

Tested by

no test coverage detected