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

Method compareSockets

Lib/test/test_socket.py:6663–6677  ·  view source on GitHub ↗
(self, org, other)

Source from the content-addressed store, hash-verified

6661 self.assertRaises(ValueError, socket.fromshare, data+b"foo")
6662
6663 def compareSockets(self, org, other):
6664 # socket sharing is expected to work only for blocking socket
6665 # since the internal python timeout value isn't transferred.
6666 self.assertEqual(org.gettimeout(), None)
6667 self.assertEqual(org.gettimeout(), other.gettimeout())
6668
6669 self.assertEqual(org.family, other.family)
6670 self.assertEqual(org.type, other.type)
6671 # If the user specified "0" for proto, then
6672 # internally windows will have picked the correct value.
6673 # Python introspection on the socket however will still return
6674 # 0. For the shared socket, the python value is recreated
6675 # from the actual value, so it may not compare correctly.
6676 if org.proto != 0:
6677 self.assertEqual(org.proto, other.proto)
6678
6679 def testShareLocal(self):
6680 data = self.serv.share(os.getpid())

Callers 2

testShareLocalMethod · 0.95
testTypesMethod · 0.95

Calls 2

assertEqualMethod · 0.45
gettimeoutMethod · 0.45

Tested by

no test coverage detected