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

Method _testNonRegularFile

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

Source from the content-addressed store, hash-verified

6881 # non regular file
6882
6883 def _testNonRegularFile(self):
6884 address = self.serv.getsockname()
6885 file = io.BytesIO(self.FILEDATA)
6886 with socket.create_connection(address) as sock, file as file:
6887 sent = sock.sendfile(file)
6888 self.assertEqual(sent, self.FILESIZE)
6889 self.assertEqual(file.tell(), self.FILESIZE)
6890 self.assertRaises(socket._GiveupOnSendfile,
6891 sock._sendfile_use_sendfile, file)
6892
6893 def testNonRegularFile(self):
6894 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