Skip to content

Commit

Permalink
Add Additional ECS Unit Test (#696)
Browse files Browse the repository at this point in the history
* added additional unit test

* removed unnecessary commentt
  • Loading branch information
alecrajeev authored and phobologic committed Feb 4, 2019
1 parent c54b30c commit 3cdfbd5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions stacker/tests/hooks/test_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,27 @@ def test_create_multiple_clusters(self):

response = client.list_clusters()
self.assertEqual(len(response["clusterArns"]), 2)

def test_fail_create_cluster(self):
with mock_ecs():
logger = "stacker.hooks.ecs"
client = boto3.client("ecs", region_name=REGION)
response = client.list_clusters()

self.assertEqual(len(response["clusterArns"]), 0)
with LogCapture(logger) as logs:
create_clusters(
provider=self.provider,
context=self.context
)

logs.check(
(
logger,
"ERROR",
"setup_clusters hook missing \"clusters\" argument"
)
)

response = client.list_clusters()
self.assertEqual(len(response["clusterArns"]), 0)

0 comments on commit 3cdfbd5

Please sign in to comment.