diff options
author | Zuul <zuul@review.openstack.org> | 2018-01-16 23:15:47 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-01-16 23:15:47 +0000 |
commit | 0a0dc01ea244228881ca8570fd286af63e1e31f1 (patch) | |
tree | ccda75179419a6e056ba5c9ee228776f26d941a9 | |
parent | d2cf6e6ddc50fccbfa36700989d63d2b5627bc38 (diff) | |
parent | 41d6ed0861d222858868375a7f0e3df86737a974 (diff) | |
download | python-cinderclient-0a0dc01ea244228881ca8570fd286af63e1e31f1.tar.gz |
Merge "Fix v2 volume unit tests"
-rw-r--r-- | cinderclient/tests/unit/v2/test_volumes.py | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/cinderclient/tests/unit/v2/test_volumes.py b/cinderclient/tests/unit/v2/test_volumes.py index 60549ea..6e5fd2f 100644 --- a/cinderclient/tests/unit/v2/test_volumes.py +++ b/cinderclient/tests/unit/v2/test_volumes.py @@ -15,13 +15,11 @@ # License for the specific language governing permissions and limitations # under the License. -from cinderclient import api_versions from cinderclient.tests.unit import utils from cinderclient.tests.unit.v2 import fakes from cinderclient.v2.volumes import Volume cs = fakes.FakeClient() -cs3 = fakes.FakeClient(api_versions.APIVersion('3.15')) class VolumesTest(utils.TestCase): @@ -213,23 +211,23 @@ class VolumesTest(utils.TestCase): self._assert_request_id(vol) def test_migrate(self): - v = cs3.volumes.get('1234') + v = cs.volumes.get('1234') self._assert_request_id(v) - vol = cs3.volumes.migrate_volume(v, 'dest', False, False) - cs3.assert_called('POST', '/volumes/1234/action', - {'os-migrate_volume': {'host': 'dest', - 'force_host_copy': False, + vol = cs.volumes.migrate_volume(v, 'dest', False, False) + cs.assert_called('POST', '/volumes/1234/action', + {'os-migrate_volume': {'host': 'dest', + 'force_host_copy': False, 'lock_volume': False}}) self._assert_request_id(vol) def test_migrate_with_lock_volume(self): - v = cs3.volumes.get('1234') + v = cs.volumes.get('1234') self._assert_request_id(v) - vol = cs3.volumes.migrate_volume(v, 'dest', False, True) - cs3.assert_called('POST', '/volumes/1234/action', - {'os-migrate_volume': {'host': 'dest', - 'force_host_copy': False, - 'lock_volume': True}}) + vol = cs.volumes.migrate_volume(v, 'dest', False, True) + cs.assert_called('POST', '/volumes/1234/action', + {'os-migrate_volume': {'host': 'dest', + 'force_host_copy': False, + 'lock_volume': True}}) self._assert_request_id(vol) def test_metadata_update_all(self): @@ -262,19 +260,19 @@ class VolumesTest(utils.TestCase): self._assert_request_id(vol) def test_volume_manage(self): - vol = cs3.volumes.manage('host1', {'k': 'v'}) + vol = cs.volumes.manage('host1', {'k': 'v'}) expected = {'host': 'host1', 'name': None, 'availability_zone': None, 'description': None, 'metadata': None, 'ref': {'k': 'v'}, 'volume_type': None, 'bootable': False} - cs3.assert_called('POST', '/os-volume-manage', {'volume': expected}) + cs.assert_called('POST', '/os-volume-manage', {'volume': expected}) self._assert_request_id(vol) def test_volume_manage_bootable(self): - vol = cs3.volumes.manage('host1', {'k': 'v'}, bootable=True) + vol = cs.volumes.manage('host1', {'k': 'v'}, bootable=True) expected = {'host': 'host1', 'name': None, 'availability_zone': None, 'description': None, 'metadata': None, 'ref': {'k': 'v'}, 'volume_type': None, 'bootable': True} - cs3.assert_called('POST', '/os-volume-manage', {'volume': expected}) + cs.assert_called('POST', '/os-volume-manage', {'volume': expected}) self._assert_request_id(vol) def test_volume_list_manageable(self): |