'If the flag for needing a reactor as an extra argument is set in the
backend_description, the ``AgentService`` passes its own reactor when
``AgentService.get_api`` calls the backend factory.'

def test_needs_reactor(self):

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