def test_socket_error(self):

    def wrapped(*_):
        (_, library) = dist.load()
        return library.SOCKET_ERROR
    with mock_library(WSAEventSelect=wrapped):
        (_, library) = dist.load()
        (sock, _) = self.create_socket_pair()
        event = self.create_wsaevent()
        with self.assertRaises(WindowsAPIError):
            WSAEventSelect(socket_from_object(sock), event, ((library.FD_WRITE | library.FD_ACCEPT) | library.FD_CONNECT))
def test_socket_error(self):

    def wrapped(*_):
        (_, library) = dist.load()
        return library.SOCKET_ERROR
    with mock_library(WSAEventSelect=wrapped):
        (_, library) = dist.load()
        (sock, _) = self.create_socket_pair()
        event = self.create_wsaevent()
        with self.assertRaises(WindowsAPIError):
            WSAEventSelect(socket_from_object(sock), event, ((library.FD_WRITE | library.FD_ACCEPT) | library.FD_CONNECT))