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

Method testGetSockOpt

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

Source from the content-addressed store, hash-verified

1551 self.assertEqual(name[1], port)
1552
1553 def testGetSockOpt(self):
1554 # Testing getsockopt()
1555 # We know a socket should start without reuse==0
1556 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1557 self.addCleanup(sock.close)
1558 reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
1559 self.assertFalse(reuse != 0, "initial mode is reuse")
1560
1561 def testSetSockOpt(self):
1562 # Testing setsockopt()

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
addCleanupMethod · 0.80
assertFalseMethod · 0.80
getsockoptMethod · 0.45

Tested by

no test coverage detected