How to use the taskcat.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_template.py View on Github external
def test_init(self):
        test_proj = (Path(__file__).parent / "./data/nested-fail").resolve()
        c = Config.create(
            project_config_path=test_proj / ".taskcat.yml", project_root=test_proj
        )
        templates = c.get_templates(project_root=test_proj)
        template = templates["taskcat-json"]
        self.assertEqual(1, len(template.children))
        self.assertEqual(4, len(template.descendents))
github aws-quickstart / taskcat / tests / test_cfn_threaded.py View on Github external
def get_tests(test_proj, _):
    c = Config.create(
        project_config_path=test_proj / ".taskcat.yml", project_root=test_proj
    )
    boto_cache = get_mock_boto_cache()
    templates = c.get_templates(boto3_cache=boto_cache, project_root=test_proj)
    regions = c.get_regions(boto3_cache=boto_cache)
    buckets = c.get_buckets(boto_cache)
    params = c.get_rendered_parameters(buckets, regions, templates)
    return (
        c.config.project.name,
        c.get_tests(
            project_root=test_proj,
            templates=templates,
            regions=regions,
            buckets=buckets,
            parameters=params,
        ),
github aws-quickstart / taskcat / tests / test_cfn_stack.py View on Github external
def test_descentants(self, m_evnts, __):
        region = make_test_region_obj("us-west-2")
        region.client = mock_client_method
        test_proj = (Path(__file__).parent / "./data/nested-fail").resolve()
        c = Config.create(
            project_config_path=test_proj / ".taskcat.yml", project_root=test_proj
        )
        templates = c.get_templates(project_root=test_proj)
        stack = Stack.create(region, "stack_name", templates["taskcat-json"])
        stack._timer.cancel()

        child = event_template.copy()
        grandchild = event_template.copy()
        child["PhysicalResourceId"] = (
            "arn:aws:cloudformation:us-east-1:123456789012:"
            "stack/Child/e722ae60-fe62-11e8-9a0e-0ae8cc519969"
        )
        child["ResourceProperties"] = (
            '{"TemplateURL": "https://test.s3.amazonaws.com/templates/'
            'test.template_inner.yaml"}'
        )