Ejemplo n.º 1
0
 def _post_network_with_provider_attrs(self, ctx, expect_errors=False):
     data = self._prepare_net_data()
     env = {'quantum.context': ctx}
     res = self.api.post(test_api_v2._get_path('networks', fmt=self.fmt),
                         self.serialize({'network': data}),
                         content_type='application/' + self.fmt,
                         extra_environ=env,
                         expect_errors=expect_errors)
     return res, data
Ejemplo n.º 2
0
 def _post_network_with_provider_attrs(self, ctx, expect_errors=False):
     data = self._prepare_net_data()
     env = {"quantum.context": ctx}
     res = self.api.post(
         test_api_v2._get_path("networks", fmt=self.fmt),
         self.serialize({"network": data}),
         content_type="application/" + self.fmt,
         extra_environ=env,
         expect_errors=expect_errors,
     )
     return res, data
Ejemplo n.º 3
0
 def _put_network_with_provider_attrs(self, ctx, expect_errors=False):
     data = self._prepare_net_data()
     env = {"quantum.context": ctx}
     instance = self.plugin.return_value
     instance.get_network.return_value = {"tenant_id": ctx.tenant_id, "shared": False}
     net_id = uuidutils.generate_uuid()
     res = self.api.put(
         test_api_v2._get_path("networks", id=net_id, fmt=self.fmt),
         self.serialize({"network": data}),
         extra_environ=env,
         expect_errors=expect_errors,
     )
     return res, data, net_id
Ejemplo n.º 4
0
 def _put_network_with_provider_attrs(self, ctx, expect_errors=False):
     data = self._prepare_net_data()
     env = {'quantum.context': ctx}
     instance = self.plugin.return_value
     instance.get_network.return_value = {
         'tenant_id': ctx.tenant_id,
         'shared': False
     }
     net_id = uuidutils.generate_uuid()
     res = self.api.put(test_api_v2._get_path('networks',
                                              id=net_id,
                                              fmt=self.fmt),
                        self.serialize({'network': data}),
                        extra_environ=env,
                        expect_errors=expect_errors)
     return res, data, net_id