def METHOD_NAME(ssh_localhost, tmpdir):
    remoteport = get_free_port()
    test_string = "Hello World"
    with ssh_localhost.forward_local_port(remoteport) as localport:
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server_socket:
            with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as send_socket:
                server_socket.bind(("127.0.0.1", remoteport))
                server_socket.listen(1)
                send_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                send_socket.connect(("127.0.0.1", localport))
                client_socket, address = server_socket.accept()
                send_socket.send(test_string.encode('utf-8'))
                assert client_socket.recv(16).decode("utf-8") == test_string