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

Method test_sendfile_partial

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

Source from the content-addressed store, hash-verified

408 self.assertEqual(self.file.tell(), len(self.DATA))
409
410 def test_sendfile_partial(self):
411 srv_proto, cli_proto = self.prepare_sendfile()
412 ret = self.run_loop(
413 self.loop.sendfile(cli_proto.transport, self.file, 1000, 100))
414 cli_proto.transport.close()
415 self.run_loop(srv_proto.done)
416 self.assertEqual(ret, 100)
417 self.assertEqual(srv_proto.nbytes, 100)
418 self.assertEqual(srv_proto.data, self.DATA[1000:1100])
419 self.assertEqual(self.file.tell(), 1100)
420
421 def test_sendfile_ssl_partial(self):
422 srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True)

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