'If the flag for needing a cluster id as an extra argument is set in the
backend_description, the ``AgentService`` passes the cluster id
extracted from the node certificate when ``AgentService.get_api`` calls
the backend factory.'

def test_needs_cluster_id(self):

    class API(PClass, ):
        cluster_id = field()
    agent_service = self.agent_service.set('backend_description', BackendDescription(name=u'foo', needs_reactor=False, needs_cluster_id=True, api_factory=API, deployer_type=DeployerType.p2p))
    api = agent_service.get_api()
    self.assertEqual(API(cluster_id=self.ca_set.node.cluster_uuid), api)
