Skip to content

Commit

Permalink
fix(init-templates): use pytest for Python sample-app init template (#…
Browse files Browse the repository at this point in the history
…5325)

* fix(init-templates): use pytest for Python sample-app init template

Fixes #5313

* "remove redundant call to get_template"
  • Loading branch information
shivlaks authored and mergify[bot] committed Dec 11, 2019
1 parent 760c935 commit 6c25da7
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import unittest
import json
import pytest

from aws_cdk import core
from %name%.%name%_stack import %name.PascalCased%Stack

from hello.hello_construct import HelloConstruct

class Test%name.PascalCased%Stack(unittest.TestCase):
def get_template():
app = core.App()
%name.PascalCased%Stack(app, "%name%")
return json.dumps(app.synth().get_stack("%name%").template)

def setUp(self):
self.app = core.App()
self.stack = core.Stack(self.app, "TestStack")

def test_sqs_queue_created():
assert("AWS::SQS::Queue" in get_template())


def test_sns_topic_created():
assert("AWS::SNS::Topic" in get_template())

0 comments on commit 6c25da7

Please sign in to comment.