cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [09/50] cloudstack-ec2stack git commit: Add VPC tests
Date Tue, 05 May 2015 13:26:02 GMT
Add VPC tests


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

Branch: refs/heads/master
Commit: 6b91349e17f82d5f466fba57908d23136aecfdfb
Parents: 174c798
Author: BroganD1993 <darrenbrogan@hotmail.com>
Authored: Fri Jul 18 19:32:40 2014 +0100
Committer: BroganD1993 <darrenbrogan@hotmail.com>
Committed: Fri Jul 18 19:32:40 2014 +0100

----------------------------------------------------------------------
 ec2stack/providers/cloudstack/vpcs.py   |   7 +-
 tests/controller_tests.py               |   1 +
 tests/data/create_vpc_invalid_cidr.json |   8 +
 tests/data/valid_create_vpc.json        | 112 ++++++++++
 tests/data/valid_delete_vpc.json        |  16 ++
 tests/data/valid_describe_vpc.json      | 104 ++++++++++
 tests/data/valid_describe_vpcs.json     | 298 +++++++++++++++++++++++++++
 tests/settings.py                       |   1 +
 tests/vpc_tests.py                      | 136 ++++++++++++
 9 files changed, 679 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/ec2stack/providers/cloudstack/vpcs.py
----------------------------------------------------------------------
diff --git a/ec2stack/providers/cloudstack/vpcs.py b/ec2stack/providers/cloudstack/vpcs.py
index 56b2e40..7386e3f 100644
--- a/ec2stack/providers/cloudstack/vpcs.py
+++ b/ec2stack/providers/cloudstack/vpcs.py
@@ -33,10 +33,9 @@ def _create_vpc_request():
     @return: Response.
     """
     args = {'command': 'createVPC'}
-    id = uuid.uuid1()
-    args['name'] = id
-    args['id'] = id
-    args['displaytext'] = id
+    name = uuid.uuid1()
+    args['name'] = name
+    args['displaytext'] = name
     args['zoneid'] = zones.get_zone(
         current_app.config['CLOUDSTACK_DEFAULT_ZONE'])['id']
     args['vpcofferingid'] = current_app.config['VPC_OFFERING_ID']

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/controller_tests.py
----------------------------------------------------------------------
diff --git a/tests/controller_tests.py b/tests/controller_tests.py
index ebb06cb..79be584 100644
--- a/tests/controller_tests.py
+++ b/tests/controller_tests.py
@@ -162,6 +162,7 @@ class ControllerTestCase(Ec2StackAppTestCase):
         data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')
 
         get = mock.Mock()
+        get.return_value.text = '{}'
         get.return_value.status_code = 401
 
         with mock.patch('requests.get', get):

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/data/create_vpc_invalid_cidr.json
----------------------------------------------------------------------
diff --git a/tests/data/create_vpc_invalid_cidr.json b/tests/data/create_vpc_invalid_cidr.json
new file mode 100644
index 0000000..7d6c174
--- /dev/null
+++ b/tests/data/create_vpc_invalid_cidr.json
@@ -0,0 +1,8 @@
+{
+    "createvpcresponse": {
+        "errorcode": 431,
+        "uuidlist": [],
+        "cserrorcode": 4350,
+        "errortext": "Invalid CIDR specified 192.168.0.2/33"
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/data/valid_create_vpc.json
----------------------------------------------------------------------
diff --git a/tests/data/valid_create_vpc.json b/tests/data/valid_create_vpc.json
new file mode 100644
index 0000000..34f6d0d
--- /dev/null
+++ b/tests/data/valid_create_vpc.json
@@ -0,0 +1,112 @@
+{
+    "queryasyncjobresultresponse": {
+        "jobprocstatus": 0,
+        "created": "2014-07-17T20:07:33+0100",
+        "cmd": "org.apache.cloudstack.api.command.admin.vpc.CreateVPCCmdByAdmin",
+        "userid": "7c7fae5a-0d1c-11e4-9f4d-080027939f80",
+        "jobstatus": 1,
+        "jobid": "24158408-b62e-4592-a236-d1f5d27f0f02",
+        "jobresultcode": 0,
+        "jobresulttype": "object",
+        "jobresult": {
+            "vpc": {
+                "account": "admin",
+                "domainid": "7c7c7604-0d1c-11e4-9f4d-080027939f80",
+                "name": "9b68e9ac-0de5-11e4-8bc0-080027b0df8c",
+                "service": [
+                    {
+                        "name": "PortForwarding",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "StaticNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "SourceNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "UserData",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dhcp",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "NetworkACL",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dns",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Vpn",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Lb",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            },
+                            {
+                                "name": "InternalLbVm"
+                            }
+                        ]
+                    }
+                ],
+                "fordisplay": true,
+                "id": "af27429e-301c-458c-956b-b67e67c83e34",
+                "tags": [],
+                "domain": "ROOT",
+                "zoneid": "c0d14920-09ae-4943-9717-6ab6c0b52de1",
+                "regionlevelvpc": false,
+                "state": "Enabled",
+                "distributedvpcrouter": false,
+                "displaytext": "9b68e9ac-0de5-11e4-8bc0-080027b0df8c",
+                "networkdomain": "cs2sandbox.simulator",
+                "vpcofferingid": "feef70e6-4d3a-438e-98c4-814527f97850",
+                "cidr": "192.168.0.2/24",
+                "zonename": "Sandbox-simulator",
+                "restartrequired": false,
+                "network": []
+            }
+        },
+        "accountid": "7c7c8e5a-0d1c-11e4-9f4d-080027939f80"
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/data/valid_delete_vpc.json
----------------------------------------------------------------------
diff --git a/tests/data/valid_delete_vpc.json b/tests/data/valid_delete_vpc.json
new file mode 100644
index 0000000..780efca
--- /dev/null
+++ b/tests/data/valid_delete_vpc.json
@@ -0,0 +1,16 @@
+{
+    "queryasyncjobresultresponse": {
+        "jobprocstatus": 0,
+        "created": "2014-07-17T20:13:24+0100",
+        "cmd": "org.apache.cloudstack.api.command.user.vpc.DeleteVPCCmd",
+        "userid": "7c7fae5a-0d1c-11e4-9f4d-080027939f80",
+        "jobstatus": 1,
+        "jobid": "fa5b1c82-a52c-4d03-947e-3f371e8e02ad",
+        "jobresultcode": 0,
+        "jobresulttype": "object",
+        "jobresult": {
+            "success": true
+        },
+        "accountid": "7c7c8e5a-0d1c-11e4-9f4d-080027939f80"
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/data/valid_describe_vpc.json
----------------------------------------------------------------------
diff --git a/tests/data/valid_describe_vpc.json b/tests/data/valid_describe_vpc.json
new file mode 100644
index 0000000..408f568
--- /dev/null
+++ b/tests/data/valid_describe_vpc.json
@@ -0,0 +1,104 @@
+{
+    "listvpcsresponse": {
+        "count": 3,
+        "vpc": [
+            {
+                "account": "admin",
+                "domainid": "7c7c7604-0d1c-11e4-9f4d-080027939f80",
+                "name": "examplevpc",
+                "service": [
+                    {
+                        "name": "PortForwarding",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "StaticNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "SourceNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "UserData",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dhcp",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "NetworkACL",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dns",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Vpn",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Lb",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            },
+                            {
+                                "name": "InternalLbVm"
+                            }
+                        ]
+                    }
+                ],
+                "fordisplay": true,
+                "id": "examplevpc",
+                "tags": [],
+                "domain": "ROOT",
+                "zoneid": "c0d14920-09ae-4943-9717-6ab6c0b52de1",
+                "regionlevelvpc": false,
+                "state": "Enabled",
+                "distributedvpcrouter": false,
+                "displaytext": "9b68e9ac-0de5-11e4-8bc0-080027b0df8c",
+                "networkdomain": "cs2sandbox.simulator",
+                "vpcofferingid": "feef70e6-4d3a-438e-98c4-814527f97850",
+                "cidr": "192.168.0.2/24",
+                "zonename": "Sandbox-simulator",
+                "restartrequired": false,
+                "network": []
+            }
+        ]
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/data/valid_describe_vpcs.json
----------------------------------------------------------------------
diff --git a/tests/data/valid_describe_vpcs.json b/tests/data/valid_describe_vpcs.json
new file mode 100644
index 0000000..171cbc3
--- /dev/null
+++ b/tests/data/valid_describe_vpcs.json
@@ -0,0 +1,298 @@
+{
+    "listvpcsresponse": {
+        "count": 3,
+        "vpc": [
+            {
+                "account": "admin",
+                "domainid": "7c7c7604-0d1c-11e4-9f4d-080027939f80",
+                "name": "9b68e9ac-0de5-11e4-8bc0-080027b0df8c",
+                "service": [
+                    {
+                        "name": "PortForwarding",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "StaticNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "SourceNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "UserData",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dhcp",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "NetworkACL",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dns",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Vpn",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Lb",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            },
+                            {
+                                "name": "InternalLbVm"
+                            }
+                        ]
+                    }
+                ],
+                "fordisplay": true,
+                "id": "af27429e-301c-458c-956b-b67e67c83e34",
+                "tags": [],
+                "domain": "ROOT",
+                "zoneid": "c0d14920-09ae-4943-9717-6ab6c0b52de1",
+                "regionlevelvpc": false,
+                "state": "Enabled",
+                "distributedvpcrouter": false,
+                "displaytext": "9b68e9ac-0de5-11e4-8bc0-080027b0df8c",
+                "networkdomain": "cs2sandbox.simulator",
+                "vpcofferingid": "feef70e6-4d3a-438e-98c4-814527f97850",
+                "cidr": "192.168.0.2/24",
+                "zonename": "Sandbox-simulator",
+                "restartrequired": false,
+                "network": []
+            },
+            {
+                "account": "admin",
+                "domainid": "7c7c7604-0d1c-11e4-9f4d-080027939f80",
+                "name": "d5768e4a-0de2-11e4-a8c4-080027b0df8c",
+                "service": [
+                    {
+                        "name": "PortForwarding",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "StaticNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "SourceNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "UserData",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dhcp",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "NetworkACL",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dns",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Vpn",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Lb",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            },
+                            {
+                                "name": "InternalLbVm"
+                            }
+                        ]
+                    }
+                ],
+                "fordisplay": true,
+                "id": "0a866c9d-4fc9-4d50-9c7c-9be9b060e18b",
+                "tags": [],
+                "domain": "ROOT",
+                "zoneid": "c0d14920-09ae-4943-9717-6ab6c0b52de1",
+                "regionlevelvpc": false,
+                "state": "Enabled",
+                "distributedvpcrouter": false,
+                "displaytext": "d5768e4a-0de2-11e4-a8c4-080027b0df8c",
+                "networkdomain": "cs2sandbox.simulator",
+                "vpcofferingid": "feef70e6-4d3a-438e-98c4-814527f97850",
+                "cidr": "192.168.0.2/24",
+                "zonename": "Sandbox-simulator",
+                "restartrequired": false,
+                "network": []
+            },
+            {
+                "account": "admin",
+                "domainid": "7c7c7604-0d1c-11e4-9f4d-080027939f80",
+                "name": "bd0eaaf4-0de2-11e4-a8c4-080027b0df8c",
+                "service": [
+                    {
+                        "name": "PortForwarding",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "StaticNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "SourceNat",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "UserData",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dhcp",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "NetworkACL",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Dns",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Vpn",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            }
+                        ]
+                    },
+                    {
+                        "name": "Lb",
+                        "provider": [
+                            {
+                                "name": "VpcVirtualRouter"
+                            },
+                            {
+                                "name": "InternalLbVm"
+                            }
+                        ]
+                    }
+                ],
+                "fordisplay": true,
+                "id": "eb02c738-2a86-48c2-af3d-17a4ad13f597",
+                "tags": [],
+                "domain": "ROOT",
+                "zoneid": "c0d14920-09ae-4943-9717-6ab6c0b52de1",
+                "regionlevelvpc": false,
+                "state": "Enabled",
+                "distributedvpcrouter": false,
+                "displaytext": "bd0eaaf4-0de2-11e4-a8c4-080027b0df8c",
+                "networkdomain": "cs2sandbox.simulator",
+                "vpcofferingid": "feef70e6-4d3a-438e-98c4-814527f97850",
+                "cidr": "192.168.0.2/24",
+                "zonename": "Sandbox-simulator",
+                "restartrequired": false,
+                "network": []
+            }
+        ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/settings.py
----------------------------------------------------------------------
diff --git a/tests/settings.py b/tests/settings.py
index 49cbbd9..c96d52b 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -6,6 +6,7 @@ CLOUDSTACK_PROTOCOL = 'https'
 CLOUDSTACK_PATH = '/compute'
 CLOUDSTACK_CUSTOM_DISK_OFFERING = 'Custom'
 CLOUDSTACK_DEFAULT_ZONE = 'CH-GV2'
+VPC_OFFERING_ID = "OFFERINGID"
 
 INSTANCE_TYPE_MAP = {'m1.small': 'micro'}
 RESOURCE_TYPE_MAP = {'exampleresourceid': 'UserVm'}

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/6b91349e/tests/vpc_tests.py
----------------------------------------------------------------------
diff --git a/tests/vpc_tests.py b/tests/vpc_tests.py
new file mode 100644
index 0000000..5ed3a26
--- /dev/null
+++ b/tests/vpc_tests.py
@@ -0,0 +1,136 @@
+#!/usr/bin/env python
+# encoding: utf-8
+
+from base64 import b64encode
+
+import mock
+import json
+
+from ec2stack.helpers import read_file, generate_signature
+from . import Ec2StackAppTestCase
+
+
+class VpcTestCase(Ec2StackAppTestCase):
+
+    def test_create_vpc(self):
+        data = self.get_example_data()
+        data['Action'] = 'CreateVpc'
+        data['CidrBlock'] = '192.168.0.0/24'
+        data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')
+
+        get_zone = mock.Mock()
+        get_zone.return_value = json.loads(read_file(
+            'tests/data/zones_search.json'
+        ))
+
+        get = mock.Mock()
+        get.return_value.text = read_file(
+            'tests/data/valid_create_vpc.json'
+        )
+        get.return_value.status_code = 200
+
+        with mock.patch('requests.get', get):
+            with mock.patch(
+                'ec2stack.providers.cloudstack.zones.get_zone',
+                get_zone
+            ):
+                response = self.post(
+                    '/',
+                    data=data
+                )
+
+        self.assert_ok(response)
+        assert 'CreateVpcResponse' in response.data
+
+    def test_create_vpc_invalid_cidr(self):
+        data = self.get_example_data()
+        data['Action'] = 'CreateVpc'
+        data['CidrBlock'] = '192.168.0.0/33'
+        data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')
+
+        get_zone = mock.Mock()
+        get_zone.return_value = json.loads(read_file(
+            'tests/data/zones_search.json'
+        ))
+
+        get = mock.Mock()
+        get.return_value.text = read_file(
+            'tests/data/create_vpc_invalid_cidr.json'
+        )
+        get.return_value.status_code = 200
+
+        with mock.patch('requests.get', get):
+            with mock.patch(
+                'ec2stack.providers.cloudstack.zones.get_zone',
+                get_zone
+            ):
+                response = self.post(
+                    '/',
+                    data=data
+                )
+
+        self.assert_bad_request(response)
+        assert 'InvalidVpcRange' in response.data
+
+    def test_describe_vpcs(self):
+        data = self.get_example_data()
+        data['Action'] = 'DescribeVpcs'
+        data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')
+
+        get = mock.Mock()
+        get.return_value.text = read_file(
+            'tests/data/valid_describe_vpcs.json'
+        )
+        get.return_value.status_code = 200
+
+        with mock.patch('requests.get', get):
+            response = self.post(
+                '/',
+                data=data
+            )
+
+        self.assert_ok(response)
+        assert 'DescribeVpcsResponse' in response.data
+
+    def test_describe_vpc_by_name(self):
+        data = self.get_example_data()
+        data['Action'] = 'DescribeVpcs'
+        data['VpcId'] = 'examplevpc'
+        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
+            )
+        print response.data
+        self.assert_ok(response)
+        assert 'DescribeVpcsResponse' in response.data
+        assert 'examplevpc' in response.data
+
+    def test_delete_vpc(self):
+        data = self.get_example_data()
+        data['Action'] = 'DeleteVpc'
+        data['VpcId'] = 'Test'
+        data['Signature'] = generate_signature(data, 'POST', 'localhost', '/')
+
+        get = mock.Mock()
+        get.return_value.text = read_file(
+            'tests/data/valid_delete_vpc.json'
+        )
+        get.return_value.status_code = 200
+
+        with mock.patch('requests.get', get):
+            response = self.post(
+                '/',
+                data=data
+            )
+
+        self.assert_ok(response)
+        assert 'DeleteVpcResponse' in response.data
\ No newline at end of file


Mime
View raw message