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

Function test_05

extra_tests/snippets/stdlib_io_stringio.py:58–69  ·  view source on GitHub ↗

Tests readline

()

Source from the content-addressed store, hash-verified

56
57
58def test_05():
59 """
60 Tests readline
61 """
62 string = "Test String 6\nnew line is here\nfinished"
63
64 f = StringIO(string)
65
66 assert f.readline() == "Test String 6\n"
67 assert f.readline() == "new line is here\n"
68 assert f.readline() == "finished"
69 assert f.readline() == ""
70
71
72if __name__ == "__main__":

Callers 1

Calls 2

StringIOClass · 0.90
readlineMethod · 0.45

Tested by

no test coverage detected