summaryrefslogtreecommitdiff
path: root/heat/tests
diff options
context:
space:
mode:
Diffstat (limited to 'heat/tests')
-rw-r--r--heat/tests/clients/test_cinder_client.py8
-rw-r--r--heat/tests/openstack/cinder/test_volume.py2
-rw-r--r--heat/tests/openstack/cinder/test_volume_type.py6
-rw-r--r--heat/tests/openstack/cinder/test_volume_utils.py9
4 files changed, 9 insertions, 16 deletions
diff --git a/heat/tests/clients/test_cinder_client.py b/heat/tests/clients/test_cinder_client.py
index bebfc574d..2d0db3b5d 100644
--- a/heat/tests/clients/test_cinder_client.py
+++ b/heat/tests/clients/test_cinder_client.py
@@ -163,14 +163,6 @@ class CinderClientAPIVersionTest(common.HeatTestCase):
client = ctx.clients.client('cinder')
self.assertEqual('3.0', client.version)
- def test_cinder_api_v2(self):
- ctx = utils.dummy_context()
- self.patchobject(ctx.keystone_session, 'get_endpoint',
- side_effect=[ks_exceptions.EndpointNotFound,
- None])
- client = ctx.clients.client('cinder')
- self.assertEqual('2.0', client.version)
-
def test_cinder_api_not_supported(self):
ctx = utils.dummy_context()
self.patchobject(ctx.keystone_session, 'get_endpoint',
diff --git a/heat/tests/openstack/cinder/test_volume.py b/heat/tests/openstack/cinder/test_volume.py
index 2dbca85e9..a6ebdfa49 100644
--- a/heat/tests/openstack/cinder/test_volume.py
+++ b/heat/tests/openstack/cinder/test_volume.py
@@ -1253,7 +1253,7 @@ class CinderVolumeTest(vt_base.VolumeTestCase):
vol.to_dict.return_value = vol_resp
rsrc.client().volumes = mock.MagicMock()
rsrc.client().volumes.get = mock.MagicMock(return_value=vol)
- rsrc.client().volume_api_version = 2
+ rsrc.client().volume_api_version = 3
rsrc.data = mock.MagicMock(return_value={'volume_type': 'lvmdriver-1'})
reality = rsrc.get_live_state(rsrc.properties)
diff --git a/heat/tests/openstack/cinder/test_volume_type.py b/heat/tests/openstack/cinder/test_volume_type.py
index 0d31ba24a..264bfbb86 100644
--- a/heat/tests/openstack/cinder/test_volume_type.py
+++ b/heat/tests/openstack/cinder/test_volume_type.py
@@ -93,7 +93,7 @@ class CinderVolumeTypeTest(common.HeatTestCase):
self._test_handle_create(is_public=False)
def test_volume_type_with_projects(self):
- self.cinderclient.volume_api_version = 2
+ self.cinderclient.volume_api_version = 3
self._test_handle_create(projects=['id1', 'id2'])
def _test_update(self, update_args, is_update_metadata=False):
@@ -179,7 +179,7 @@ class CinderVolumeTypeTest(common.HeatTestCase):
props['projects'] = ['id1']
self.my_volume_type.t = self.my_volume_type.t.freeze(properties=props)
self.my_volume_type.reparse()
- self.cinderclient.volume_api_version = 2
+ self.cinderclient.volume_api_version = 3
self.stub_KeystoneProjectConstraint()
ex = self.assertRaises(exception.StackValidationFailed,
self.my_volume_type.validate)
@@ -194,7 +194,7 @@ class CinderVolumeTypeTest(common.HeatTestCase):
props['projects'] = ['id1']
self.my_volume_type.t = self.my_volume_type.t.freeze(properties=props)
self.my_volume_type.reparse()
- self.cinderclient.volume_api_version = 2
+ self.cinderclient.volume_api_version = 3
self.stub_KeystoneProjectConstraint()
self.assertIsNone(self.my_volume_type.validate())
diff --git a/heat/tests/openstack/cinder/test_volume_utils.py b/heat/tests/openstack/cinder/test_volume_utils.py
index e5aee1bc1..9a05923a6 100644
--- a/heat/tests/openstack/cinder/test_volume_utils.py
+++ b/heat/tests/openstack/cinder/test_volume_utils.py
@@ -10,11 +10,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-
-from cinderclient.v2 import client as cinderclient
-import mock
import six
+from unittest import mock
+
+from cinderclient.v3 import client as cinderclient
+
from heat.engine.clients.os import cinder
from heat.engine.clients.os import nova
from heat.engine.resources.aws.ec2 import volume as aws_vol
@@ -31,7 +32,7 @@ class VolumeTestCase(common.HeatTestCase):
super(VolumeTestCase, self).setUp()
self.fc = fakes_nova.FakeClient()
self.cinder_fc = cinderclient.Client('username', 'password')
- self.cinder_fc.volume_api_version = 2
+ self.cinder_fc.volume_api_version = 3
self.patchobject(cinder.CinderClientPlugin, '_create',
return_value=self.cinder_fc)
self.patchobject(nova.NovaClientPlugin, 'client',