Merge "Stop using mox in api/openstack/fakes.py"
This commit is contained in:
commit
c1b9450f5d
@ -53,8 +53,8 @@ class ImagesControllerTestV21(test.NoDBTestCase):
|
|||||||
self.flags(api_servers=['http://localhost:9292'], group='glance')
|
self.flags(api_servers=['http://localhost:9292'], group='glance')
|
||||||
fakes.stub_out_networking(self)
|
fakes.stub_out_networking(self)
|
||||||
fakes.stub_out_key_pair_funcs(self)
|
fakes.stub_out_key_pair_funcs(self)
|
||||||
fakes.stub_out_compute_api_snapshot(self.stubs)
|
fakes.stub_out_compute_api_snapshot(self)
|
||||||
fakes.stub_out_compute_api_backup(self.stubs)
|
fakes.stub_out_compute_api_backup(self)
|
||||||
|
|
||||||
self.controller = self.image_controller_class()
|
self.controller = self.image_controller_class()
|
||||||
self.url_prefix = "http://localhost%s/images" % self.url_base
|
self.url_prefix = "http://localhost%s/images" % self.url_base
|
||||||
|
@ -84,7 +84,7 @@ class ServerActionsControllerTestV21(test.TestCase):
|
|||||||
instance_update_and_get_original)
|
instance_update_and_get_original)
|
||||||
|
|
||||||
fakes.stub_out_nw_api(self)
|
fakes.stub_out_nw_api(self)
|
||||||
fakes.stub_out_compute_api_snapshot(self.stubs)
|
fakes.stub_out_compute_api_snapshot(self)
|
||||||
fake.stub_out_image_service(self)
|
fake.stub_out_image_service(self)
|
||||||
self.flags(allow_instance_snapshots=True,
|
self.flags(allow_instance_snapshots=True,
|
||||||
enable_instance_password=True,
|
enable_instance_password=True,
|
||||||
|
@ -30,7 +30,6 @@ from nova.api.openstack import compute
|
|||||||
from nova.api.openstack.compute import versions
|
from nova.api.openstack.compute import versions
|
||||||
from nova.api.openstack import urlmap
|
from nova.api.openstack import urlmap
|
||||||
from nova.api.openstack import wsgi as os_wsgi
|
from nova.api.openstack import wsgi as os_wsgi
|
||||||
from nova.compute import api as compute_api
|
|
||||||
from nova.compute import flavors
|
from nova.compute import flavors
|
||||||
from nova.compute import vm_states
|
from nova.compute import vm_states
|
||||||
import nova.conf
|
import nova.conf
|
||||||
@ -128,7 +127,7 @@ def stub_out_networking(test):
|
|||||||
test.stub_out('oslo_utils.netutils.get_my_ipv4', get_my_ip)
|
test.stub_out('oslo_utils.netutils.get_my_ipv4', get_my_ip)
|
||||||
|
|
||||||
|
|
||||||
def stub_out_compute_api_snapshot(stubs):
|
def stub_out_compute_api_snapshot(test):
|
||||||
|
|
||||||
def snapshot(self, context, instance, name, extra_properties=None):
|
def snapshot(self, context, instance, name, extra_properties=None):
|
||||||
# emulate glance rejecting image names which are too long
|
# emulate glance rejecting image names which are too long
|
||||||
@ -137,15 +136,14 @@ def stub_out_compute_api_snapshot(stubs):
|
|||||||
return dict(id='123', status='ACTIVE', name=name,
|
return dict(id='123', status='ACTIVE', name=name,
|
||||||
properties=extra_properties)
|
properties=extra_properties)
|
||||||
|
|
||||||
stubs.Set(compute_api.API, 'snapshot', snapshot)
|
test.stub_out('nova.compute.api.API.snapshot', snapshot)
|
||||||
|
|
||||||
|
|
||||||
class stub_out_compute_api_backup(object):
|
class stub_out_compute_api_backup(object):
|
||||||
|
|
||||||
def __init__(self, stubs):
|
def __init__(self, test):
|
||||||
self.stubs = stubs
|
|
||||||
self.extra_props_last_call = None
|
self.extra_props_last_call = None
|
||||||
stubs.Set(compute_api.API, 'backup', self.backup)
|
test.stub_out('nova.compute.api.API.backup', self.backup)
|
||||||
|
|
||||||
def backup(self, context, instance, name, backup_type, rotation,
|
def backup(self, context, instance, name, backup_type, rotation,
|
||||||
extra_properties=None):
|
extra_properties=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user