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

Method _testEmptyFileSend

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

Source from the content-addressed store, hash-verified

6899 # empty file
6900
6901 def _testEmptyFileSend(self):
6902 address = self.serv.getsockname()
6903 filename = os_helper.TESTFN + "2"
6904 with open(filename, 'wb'):
6905 self.addCleanup(os_helper.unlink, filename)
6906 file = open(filename, 'rb')
6907 with socket.create_connection(address) as sock, file as file:
6908 meth = self.meth_from_sock(sock)
6909 sent = meth(file)
6910 self.assertEqual(sent, 0)
6911 self.assertEqual(file.tell(), 0)
6912
6913 def testEmptyFileSend(self):
6914 conn = self.accept_conn()

Callers

nothing calls this directly

Calls 8

meth_from_sockMethod · 0.95
methFunction · 0.85
addCleanupMethod · 0.80
openFunction · 0.50
getsocknameMethod · 0.45
create_connectionMethod · 0.45
assertEqualMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected