code: def test_send_connecting(conn):
      conn.state = ConnectionStates.CONNECTING
      f = conn.send("foobar")
      assert f.failed() is True
      assert isinstance(f.exception, Errors.NodeNotReadyError)
  
imports: from __future__ import absolute_import
  from errno import EALREADY, EINPROGRESS, EISCONN, ECONNRESET
  import socket
  import mock
  import pytest
  from kafka.conn import BrokerConnection, ConnectionStates, collect_hosts
  from kafka.protocol.api import RequestHeader
  from kafka.protocol.metadata import MetadataRequest
  from kafka.protocol.produce import ProduceRequest
  import kafka.errors
label_desc: Use image node_id 11 for calling a global function with example usage: test_send_connecting(conn) without return types