How to use the taskcat._config.Config.create function in taskcat

To help you get started, we’ve selected a few taskcat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-quickstart / taskcat / tests / test_cfn_lint.py View on Github external
def test_passed(self, m_boto):
        cwd = os.getcwd()
        try:
            config_path = Path(
                build_test_case("/tmp/lint_test_output/", test_cases[0])
            ).resolve()
            project_root = config_path.parent.parent
            config = Config.create(
                project_config_path=config_path, project_root=project_root
            )
            templates = config.get_templates(project_root)
            lint = Lint(config=config, templates=templates)
            self.assertEqual(lint.passed, True)

            lint_key = list(lint.lints[0])[0]
            result_key = list(lint.lints[0][lint_key]["results"])[0]
            test = lint.lints[0][lint_key]["results"][result_key]
            rule = mock.Mock(return_val="[E0001] some error")
            rule.rule.id = "E0001"
            rule.linenumber = 123
            rule.rule.shortdesc = "short error"
            rule.message = "some error"
            test.append(rule)
            lint.strict = True
github aws-quickstart / taskcat / tests / test_config.py View on Github external
def test_standalone_template(self):

        base_path = "./" if os.getcwd().endswith("/tests") else "./tests/"
        base_path = Path(base_path + "data/legacy_test/templates/").resolve()

        Config.create(template_file=base_path / "test.template.yaml")