(self)
| 7274 | self.assertEqual(sock.type, socket.SOCK_STREAM) |
| 7275 | |
| 7276 | def test_reuse_port(self): |
| 7277 | if not hasattr(socket, "SO_REUSEPORT"): |
| 7278 | with self.assertRaises(ValueError): |
| 7279 | socket.create_server(("localhost", 0), reuse_port=True) |
| 7280 | else: |
| 7281 | with socket.create_server(("localhost", 0)) as sock: |
| 7282 | opt = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) |
| 7283 | self.assertEqual(opt, 0) |
| 7284 | with socket.create_server(("localhost", 0), reuse_port=True) as sock: |
| 7285 | opt = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) |
| 7286 | self.assertNotEqual(opt, 0) |
| 7287 | |
| 7288 | @unittest.skipIf(not hasattr(_socket, 'IPPROTO_IPV6') or |
| 7289 | not hasattr(_socket, 'IPV6_V6ONLY'), |
nothing calls this directly
no test coverage detected