'``AgentScript`` calls the ``service_factory`` with the reactor
and options passed to ``AgentScript.main``.'

def test_service_factory_called_with_main_arguments(self):

    args = []
    service = Service()
    def service_factory(reactor, options):
        args.append((reactor, options))
        return service
    agent = AgentScript(service_factory=service_factory)
    agent.main(self.reactor, self.options)
    self.assertEqual([(self.reactor, self.options)], args)
