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

Method _testCountWithOffset

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

Source from the content-addressed store, hash-verified

6977 # count + offset
6978
6979 def _testCountWithOffset(self):
6980 address = self.serv.getsockname()
6981 file = open(os_helper.TESTFN, 'rb')
6982 with socket.create_connection(address, timeout=2) as sock, file as file:
6983 count = 100007
6984 meth = self.meth_from_sock(sock)
6985 sent = meth(file, offset=2007, count=count)
6986 self.assertEqual(sent, count)
6987 self.assertEqual(file.tell(), count + 2007)
6988
6989 def testCountWithOffset(self):
6990 count = 100007

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected