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

Method test_trailers

Lib/test/test_os.py:3983–3995  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3981
3982 @requires_headers_trailers
3983 async def test_trailers(self):
3984 TESTFN2 = os_helper.TESTFN + "2"
3985 file_data = b"abcdef"
3986
3987 self.addCleanup(os_helper.unlink, TESTFN2)
3988 create_file(TESTFN2, file_data)
3989
3990 with open(TESTFN2, 'rb') as f:
3991 await self.async_sendfile(self.sockno, f.fileno(), 0, 5,
3992 trailers=[b"123456", b"789"])
3993 self.client.close()
3994 await self.server.wait_closed()
3995 self.assertEqual(self.server_buffer, b"abcde123456789")
3996
3997 @requires_headers_trailers
3998 @requires_32b

Callers

nothing calls this directly

Calls 8

async_sendfileMethod · 0.95
addCleanupMethod · 0.80
create_fileFunction · 0.70
openFunction · 0.50
filenoMethod · 0.45
closeMethod · 0.45
wait_closedMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected