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

Method test_newline

Lib/test/test_bz2.py:1192–1198  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1190 self.assertEqual(f.read(), "foobar")
1191
1192 def test_newline(self):
1193 # Test with explicit newline (universal newline mode disabled).
1194 text = self.TEXT.decode("ascii")
1195 with self.open(self.filename, "wt", encoding="utf-8", newline="\n") as f:
1196 f.write(text)
1197 with self.open(self.filename, "rt", encoding="utf-8", newline="\r") as f:
1198 self.assertEqual(f.readlines(), [text])
1199
1200
1201def tearDownModule():

Callers

nothing calls this directly

Calls 5

openMethod · 0.95
decodeMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
readlinesMethod · 0.45

Tested by

no test coverage detected