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
Fixes #5313
  • Loading branch information
shivlaks committed Dec 6, 2019
1 parent d4562b7 commit 9f304f3
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
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():
template_json = get_template()
assert("AWS::SQS::Queue" in get_template())


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

0 comments on commit 9f304f3

Please sign in to comment.