'``FlockerScriptRunner.main`` uses ``self.sys_module.argv``.'

def test_main_uses_sysargv(self):

    class SpyOptions(usage.Options, ):
        def opt_hello(self, value):
            self.value = value
    class SpyScript(object, ):
        def main(self, reactor, arguments):
            self.reactor = reactor
            self.arguments = arguments
            return succeed(None)
    options = SpyOptions()
    script = SpyScript()
    sys = FakeSysModule(argv=['flocker', '--hello', 'world'])
    from twisted.test.test_task import _FakeReactor
    fakeReactor = _FakeReactor()
    runner = FlockerScriptRunner(script, options, reactor=fakeReactor, sys_module=sys, logging=False)
    self.assertRaises(SystemExit, runner.main)
    self.assertEqual('world', script.arguments.value)
