(self)
| 7364 | self.assertEqual(sock.type, socket.SOCK_STREAM) |
| 7365 | |
| 7366 | def test_reuse_port(self): |
| 7367 | if not hasattr(socket, "SO_REUSEPORT"): |
| 7368 | with self.assertRaises(ValueError): |
| 7369 | socket.create_server(("localhost", 0), reuse_port=True) |
| 7370 | else: |
| 7371 | with socket.create_server(("localhost", 0)) as sock: |
| 7372 | opt = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) |
| 7373 | self.assertEqual(opt, 0) |
| 7374 | with socket.create_server(("localhost", 0), reuse_port=True) as sock: |
| 7375 | opt = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) |
| 7376 | self.assertNotEqual(opt, 0) |
| 7377 | |
| 7378 | @unittest.skipIf(not hasattr(_socket, 'IPPROTO_IPV6') or |
| 7379 | not hasattr(_socket, 'IPV6_V6ONLY'), |
nothing calls this directly
no test coverage detected