From ec802fc8b10c7d1df4a7cfad92484083dcb70b60 Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Tue, 9 Nov 2021 12:29:43 +0000 Subject: [PATCH] chore: fix python app v2 init template The init template tests now run tests for each language. However, the python app init template does not have any defined tests (the sample test is commented out). This causes the init template test to fail. Leaving the SQS assertion commented out, but uncommenting the rest of the test so a no-op test runs successfully. --- .../test_%name.PythonModule%_stack.template.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/v2/app/python/tests/unit/test_%name.PythonModule%_stack.template.py b/packages/aws-cdk/lib/init-templates/v2/app/python/tests/unit/test_%name.PythonModule%_stack.template.py index 40f77fd686a77..2bf2309dca779 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/python/tests/unit/test_%name.PythonModule%_stack.template.py +++ b/packages/aws-cdk/lib/init-templates/v2/app/python/tests/unit/test_%name.PythonModule%_stack.template.py @@ -1,14 +1,14 @@ -# import aws_cdk as core -# import aws_cdk.assertions as assertions +import aws_cdk as core +import aws_cdk.assertions as assertions -# from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack +from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack # example tests. To run these tests, uncomment this file along with the example # resource in %name.PythonModule%/%name.PythonModule%_stack.py -# def test_sqs_queue_created(): -# app = core.App() -# stack = %name.PascalCased%Stack(app, "%name.StackName%") -# template = assertions.Template.from_stack(stack) +def test_sqs_queue_created(): + app = core.App() + stack = %name.PascalCased%Stack(app, "%name.StackName%") + template = assertions.Template.from_stack(stack) # template.has_resource_properties("AWS::SQS::Queue", { # "VisibilityTimeout": 300