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

Method test_writelines

Lib/test/test_asyncio/test_transports.py:30–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.assertIs(default, transport.get_extra_info('unknown', default))
29
30 def test_writelines(self):
31 writer = mock.Mock()
32
33 class MyTransport(asyncio.Transport):
34 def write(self, data):
35 writer(data)
36
37 transport = MyTransport()
38
39 transport.writelines([b'line1',
40 bytearray(b'line2'),
41 memoryview(b'line3')])
42 self.assertEqual(1, writer.call_count)
43 writer.assert_called_with(b'line1line2line3')
44
45 def test_not_implemented(self):
46 transport = asyncio.Transport()

Callers

nothing calls this directly

Calls 4

MyTransportClass · 0.85
assert_called_withMethod · 0.80
writelinesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected