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

Method test_sendfile

Lib/test/test_asyncio/test_sendfile.py:308–317  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

306 tr.close()
307
308 def test_sendfile(self):
309 srv_proto, cli_proto = self.prepare_sendfile()
310 ret = self.run_loop(
311 self.loop.sendfile(cli_proto.transport, self.file))
312 cli_proto.transport.close()
313 self.run_loop(srv_proto.done)
314 self.assertEqual(ret, len(self.DATA))
315 self.assertEqual(srv_proto.nbytes, len(self.DATA))
316 self.assertEqual(srv_proto.data, self.DATA)
317 self.assertEqual(self.file.tell(), len(self.DATA))
318
319 def test_sendfile_force_fallback(self):
320 srv_proto, cli_proto = self.prepare_sendfile()

Callers

nothing calls this directly

Calls 6

prepare_sendfileMethod · 0.95
run_loopMethod · 0.45
sendfileMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected