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

Method _testOffset

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

Source from the content-addressed store, hash-verified

6815 # offset
6816
6817 def _testOffset(self):
6818 address = self.serv.getsockname()
6819 file = open(os_helper.TESTFN, 'rb')
6820 with socket.create_connection(address) as sock, file as file:
6821 meth = self.meth_from_sock(sock)
6822 sent = meth(file, offset=5000)
6823 self.assertEqual(sent, self.FILESIZE - 5000)
6824 self.assertEqual(file.tell(), self.FILESIZE)
6825
6826 def testOffset(self):
6827 conn = self.accept_conn()

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