Skip to content
Permalink
Browse files
Forgot vpc test for invalid vpc id
  • Loading branch information
brogand93 committed Jul 22, 2014
1 parent 055932e commit 7c5417e9a1a7a7fc53932651da99d212ebf53977
Showing 1 changed file with 22 additions and 0 deletions.
@@ -114,6 +114,28 @@ def test_describe_vpc_by_name(self):
assert 'DescribeVpcsResponse' in response.data
assert 'examplevpc' in response.data


def test_describe_vpc_by_name_invalid_name(self):
data = self.get_example_data()
data['Action'] = 'DescribeVpcs'
data['VpcId'] = 'invalidevpc'
data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')

get = mock.Mock()
get.return_value.text = read_file(
'tests/data/valid_describe_vpc.json'
)
get.return_value.status_code = 200

with mock.patch('requests.get', get):
response = self.post(
'/',
data=data
)

self.assert_bad_request(response)
assert 'InvalidVpcID.NotFound' in response.data

def test_delete_vpc(self):
data = self.get_example_data()
data['Action'] = 'DeleteVpc'

0 comments on commit 7c5417e

Please sign in to comment.