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

Function test_04

extra_tests/snippets/stdlib_io_stringio.py:43–55  ·  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

41
42
43def test_04():
44 """
45 Tests that the read method increments the
46 cursor position and the seek method moves
47 the cursor to the appropriate position
48 """
49 string = "Test String 4"
50 f = StringIO(string)
51
52 assert f.read(4) == "Test"
53 assert f.tell() == 4
54 assert f.seek(0) == 0
55 assert f.read(4) == "Test"
56
57
58def test_05():

Callers 1

Calls 4

StringIOClass · 0.90
readMethod · 0.45
tellMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected