Пример #1
0
    def test_parse_args_omit_manifest(self):
        """ Ensure parsing of proper arguments when a manifest is not provided """

        args = "--basedir tests/fixtures/test-data create"
        parsed_args = cli.parse_args(args.split())

        self.assertEqual(parsed_args.manifest_path, "tests/fixtures/test-data/.manifest.yaml")
Пример #2
0
    def test_parse_args(self):
        """ Ensure parsing of proper arguments """

        args = "--basedir tests/fixtures/test-data --manifest .test_manifest.yaml create"
        parsed_args = cli.parse_args(args.split())

        self.assertEqual(parsed_args.basedir, "tests/fixtures/test-data")
        self.assertEqual(parsed_args.manifest_path, ".test_manifest.yaml")
        self.assertEqual(parsed_args.action, "create")
        self.assertEqual(parsed_args.log_level, "info")
Пример #3
0
    def test_parse_args_return_when_none(self):
        """ Ensure function returns parser object when None is passed """

        parsed_args = cli.parse_args(None)

        self.assertEqual(type(parsed_args), argparse.ArgumentParser)