]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Stop using mox stubs in test_snapshots.py
authorAnh Tran <anhtt@vn.fujitsu.com>
Fri, 27 May 2016 02:21:51 +0000 (09:21 +0700)
committerAnh Tran <anhtt@vn.fujitsu.com>
Tue, 11 Oct 2016 01:07:19 +0000 (01:07 +0000)
Replace 'stubs.Set' with 'stub_out' in
nova/tests/unit/api/openstack/compute/test_snapshots.py

Part of blueprint remove-mox-ocata

Change-Id: I7ca758dcb451a07f2f2d608e7c5ea9423a7a7cf1

nova/tests/unit/api/openstack/compute/test_snapshots.py

index 8cdc7b6858c5909bfcc86448263337325926c7b6..4bf614b49b0406fcbd3af8da993cbb6b99642cb8 100644 (file)
@@ -32,16 +32,17 @@ class SnapshotApiTestV21(test.NoDBTestCase):
     def setUp(self):
         super(SnapshotApiTestV21, self).setUp()
         fakes.stub_out_networking(self)
-        self.stubs.Set(cinder.API, "create_snapshot",
-                       fakes.stub_snapshot_create)
-        self.stubs.Set(cinder.API, "create_snapshot_force",
-                       fakes.stub_snapshot_create)
-        self.stubs.Set(cinder.API, "delete_snapshot",
-                       fakes.stub_snapshot_delete)
-        self.stubs.Set(cinder.API, "get_snapshot", fakes.stub_snapshot_get)
-        self.stubs.Set(cinder.API, "get_all_snapshots",
-                       fakes.stub_snapshot_get_all)
-        self.stubs.Set(cinder.API, "get", fakes.stub_volume_get)
+        self.stub_out("nova.volume.cinder.API.create_snapshot",
+                      fakes.stub_snapshot_create)
+        self.stub_out("nova.volume.cinder.API.create_snapshot_force",
+                      fakes.stub_snapshot_create)
+        self.stub_out("nova.volume.cinder.API.delete_snapshot",
+                      fakes.stub_snapshot_delete)
+        self.stub_out("nova.volume.cinder.API.get_snapshot",
+                      fakes.stub_snapshot_get)
+        self.stub_out("nova.volume.cinder.API.get_all_snapshots",
+                      fakes.stub_snapshot_get_all)
+        self.stub_out("nova.volume.cinder.API.get", fakes.stub_volume_get)
         self.req = fakes.HTTPRequest.blank('')
 
     def _test_snapshot_create(self, force):