Пример #1
0
 def _test_webopen(self, args, expected_url):
     o = runner.Options()
     o.parseOptions(["--node-directory",
                     self.get_clientdir(), "webopen"] + list(args))
     urls = []
     rc = cli.webopen(o, urls.append)
     self.failUnlessReallyEqual(rc, 0)
     self.failUnlessReallyEqual(len(urls), 1)
     self.failUnlessReallyEqual(urls[0], expected_url)
Пример #2
0
    def test_daemonize_options(self):
        parent = runner.Options()
        opts = DaemonizeOptions()
        opts.parent = parent
        opts.parseArgs()

        # just gratuitous coverage, ensureing we don't blow up on
        # these methods.
        opts.getSynopsis()
        opts.getUsage()
Пример #3
0
 def _test_webopen(self, args, expected_url):
     o = runner.Options()
     o.parseOptions(["--node-directory",
                     self.get_clientdir(), "webopen"] + list(args))
     urls = []
     o.subOptions.stdout = StringIO()
     o.subOptions.stderr = StringIO()
     o.subOptions.stdin = StringIO()
     rc = cli.webopen(o.subOptions, urls.append)
     self.failUnlessReallyEqual(rc, 0)
     self.failUnlessReallyEqual(len(urls), 1)
     self.assertEqual(urls[0], expected_url)
Пример #4
0
def parse_options(basedir, command, args):
    o = runner.Options()
    o.parseOptions(["--node-directory", basedir, command] + args)
    while hasattr(o, "subOptions"):
        o = o.subOptions
    return o