'``AgentServiceFactory.main`` calls its ``deployer_factory`` with one
of the node\'s IPs.'

def test_deployer_factory_called_with_ip(self):

    spied = []
    def deployer_factory(node_uuid, hostname, cluster_uuid):
        spied.append(IPAddress(hostname))
        return object()
    reactor = MemoryCoreReactor()
    options = DatasetAgentOptions()
    options.parseOptions(['--agent-config', self.config.path])
    agent = self.service_factory(deployer_factory=deployer_factory)
    agent.get_service(reactor, options)
    self.assertIn(spied[0], get_all_ips())
