예제 #1
0
    def test_flow_parser_instantiates_argparser(self):
        flow_parser(prog='jobrunner post simple_http_webserver',
                    description='Post a job that runs a simple HTTP webserver')

        self.argument_parser.assert_called_once_with(
            prog='jobrunner post simple_http_webserver',
            description='Post a job that runs a simple HTTP webserver')
예제 #2
0
    def test_flow_parser_adds_hierarchy_argument(self):
        flow_parser()

        self.argument_parser.return_value.add_argument.assert_called_once_with(
            '--hierarchy',
            action='store_true',
            help="Print the execution graph of the flow that would be posted")
예제 #3
0
def parse_youtube_dl_arguments(args=None):
    """
    Parse the commandline options for posting a job that
    downloads videos from YouTube to the local disk of the
    conductor running the flow
    :param list args: Args to pass to the arg parser.
    Will use argv if none specified.
    :return obj args: parsed arguments
    """
    parser = flow_parser(
        prog="jobrunner post youtube_dl",
        description='Post a job that downloads videos from YouTube')
    parser.add_argument('channels_file',
                        help="Path to a file containing a list of channels to "
                        "download the videos of")
    return parse_arguments(parser, args=args)
예제 #4
0
def parse_webserver_arguments(args=None):
    """
    Parse the commandline options for posting a job that
    runs a simple HTTP webserver
    :param list args: Args to pass to the arg parser.
    Will use argv if none specified.
    :return obj args: parsed arguments
    """
    parser = flow_parser(
        prog="jobrunner post simple_http_webserver",
        description='Post a job that runs a simple HTTP webserver')
    parser.add_argument(
        '--port',
        '-p',
        type=int,
        default=8080,
        help="The port to use to run the webserver on. Defaults to 8080")
    return parse_arguments(parser, args=args)
예제 #5
0
    def test_flow_parser_returns_parser(self):
        ret = flow_parser()

        self.assertEqual(ret, self.argument_parser.return_value)