'L{Twist.main} runs the runner with arguments corresponding to the given
command line arguments.'

def test_main(self):

    self.patchStartService()
    runners = []
    class Runner(object, ):
        def __init__(self, **kwargs):
            self.args = kwargs
            self.runs = 0
            runners.append(self)
        def run(self):
            self.runs += 1
    self.patch(_twist, 'Runner', Runner)
    Twist.main(['twist', '--reactor=default', '--log-format=json', 'web'])
    self.assertEqual(len(self.serviceStarts), 1)
    self.assertEqual(len(runners), 1)
    self.assertEqual(runners[0].args, dict(reactor=self.installedReactors['default'], defaultLogLevel=LogLevel.info, logFile=stdout, fileLogObserverFactory=jsonFileLogObserver))
    self.assertEqual(runners[0].runs, 1)
