You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by se...@apache.org on 2015/05/05 15:26:10 UTC

[17/50] cloudstack-ec2stack git commit: Forgot vpc test for invalid vpc id

Forgot vpc test for invalid vpc id


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/commit/7c5417e9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/tree/7c5417e9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/diff/7c5417e9

Branch: refs/heads/master
Commit: 7c5417e9a1a7a7fc53932651da99d212ebf53977
Parents: 055932e
Author: BroganD1993 <da...@hotmail.com>
Authored: Tue Jul 22 19:19:24 2014 +0100
Committer: BroganD1993 <da...@hotmail.com>
Committed: Tue Jul 22 19:19:24 2014 +0100

----------------------------------------------------------------------
 tests/vpc_tests.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/7c5417e9/tests/vpc_tests.py
----------------------------------------------------------------------
diff --git a/tests/vpc_tests.py b/tests/vpc_tests.py
index da05c58..b8df263 100644
--- a/tests/vpc_tests.py
+++ b/tests/vpc_tests.py
@@ -114,6 +114,28 @@ class VpcTestCase(Ec2StackAppTestCase):
         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'