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

Method test_writelines

Lib/test/test_io.py:3438–3444  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3436 self.assertEqual(reads, "A"*127+"\nB")
3437
3438 def test_writelines(self):
3439 l = ['ab', 'cd', 'ef']
3440 buf = self.BytesIO()
3441 txt = self.TextIOWrapper(buf, encoding="utf-8")
3442 txt.writelines(l)
3443 txt.flush()
3444 self.assertEqual(buf.getvalue(), b'abcdef')
3445
3446 def test_writelines_userlist(self):
3447 l = UserList(['ab', 'cd', 'ef'])

Callers

nothing calls this directly

Calls 4

flushMethod · 0.95
getvalueMethod · 0.95
writelinesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected