MCPcopy Index your code
hub / github.com/python/cpython / test_writelines

Method test_writelines

Lib/test/test_io/test_textio.py:778–784  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

776 self.assertEqual(reads, "A"*127+"\nB")
777
778 def test_writelines(self):
779 l = ['ab', 'cd', 'ef']
780 buf = self.BytesIO()
781 txt = self.TextIOWrapper(buf, encoding="utf-8")
782 txt.writelines(l)
783 txt.flush()
784 self.assertEqual(buf.getvalue(), b'abcdef')
785
786 def test_writelines_userlist(self):
787 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