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

Method _testNonRegularFile

Lib/test/test_socket.py:6780–6788  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6778 # non regular file
6779
6780 def _testNonRegularFile(self):
6781 address = self.serv.getsockname()
6782 file = io.BytesIO(self.FILEDATA)
6783 with socket.create_connection(address) as sock, file as file:
6784 sent = sock.sendfile(file)
6785 self.assertEqual(sent, self.FILESIZE)
6786 self.assertEqual(file.tell(), self.FILESIZE)
6787 self.assertRaises(socket._GiveupOnSendfile,
6788 sock._sendfile_use_sendfile, file)
6789
6790 def testNonRegularFile(self):
6791 conn = self.accept_conn()

Callers

nothing calls this directly

Calls 6

tellMethod · 0.95
getsocknameMethod · 0.45
create_connectionMethod · 0.45
sendfileMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected