Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
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,
),
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"}'
)