From 76c69c0dc5b38e83c030f509da2cceed3a8e30db Mon Sep 17 00:00:00 2001 From: Theodore Wong Date: Thu, 31 May 2018 16:31:04 -0700 Subject: [PATCH] Added region parameter to boto3 calls --- tests/test_cloudformation/test_import_value.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_cloudformation/test_import_value.py b/tests/test_cloudformation/test_import_value.py index 297c1a7be..04c2b5801 100644 --- a/tests/test_cloudformation/test_import_value.py +++ b/tests/test_cloudformation/test_import_value.py @@ -11,6 +11,8 @@ from botocore.exceptions import ClientError # Package modules from moto import mock_cloudformation +AWS_REGION = 'us-west-1' + SG_STACK_NAME = 'simple-sg-stack' SG_TEMPLATE = """ AWSTemplateFormatVersion: 2010-09-09 @@ -63,7 +65,7 @@ class TestSimpleInstance(unittest.TestCase): def test_simple_instance(self): """Test that we can create a simple CloudFormation stack that imports values from an existing CloudFormation stack""" with mock_cloudformation(): - client = boto3.client('cloudformation') + client = boto3.client('cloudformation', region_name=AWS_REGION) client.create_stack(StackName=SG_STACK_NAME, TemplateBody=SG_TEMPLATE) response = client.create_stack(StackName=EC2_STACK_NAME, TemplateBody=EC2_TEMPLATE) self.assertIn('StackId', response) @@ -77,7 +79,7 @@ class TestSimpleInstance(unittest.TestCase): def test_simple_instance_missing_export(self): """Test that we get an exception if a CloudFormation stack tries to imports a non-existent export value""" with mock_cloudformation(): - client = boto3.client('cloudformation') + client = boto3.client('cloudformation', region_name=AWS_REGION) with self.assertRaises(ClientError) as e: client.create_stack(StackName=EC2_STACK_NAME, TemplateBody=EC2_TEMPLATE) self.assertIn('Error', e.exception.response)