diff --git a/cinderclient/tests/unit/v3/test_group_types.py b/cinderclient/tests/unit/v3/test_group_types.py index 45147f2a8..7918bf11d 100644 --- a/cinderclient/tests/unit/v3/test_group_types.py +++ b/cinderclient/tests/unit/v3/test_group_types.py @@ -21,6 +21,7 @@ from cinderclient.tests.unit import utils from cinderclient.tests.unit.v3 import fakes cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.11')) +pre_cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.10')) class GroupTypesTest(utils.TestCase): @@ -33,8 +34,6 @@ class GroupTypesTest(utils.TestCase): self.assertIsInstance(t, group_types.GroupType) def test_list_group_types_pre_version(self): - pre_cs = fakes.FakeClient(api_version= - api_versions.APIVersion('3.10')) self.assertRaises(exc.VersionNotFoundForAPIMethod, pre_cs.group_types.list) @@ -95,6 +94,11 @@ class GroupTypesTest(utils.TestCase): {'group_specs': {'k': 'v'}}) self._assert_request_id(res) + def test_set_key_pre_version(self): + t = group_types.GroupType(pre_cs, {'id': 1}) + self.assertRaises(exc.VersionNotFoundForAPIMethod, + t.set_keys, {'k': 'v'}) + def test_unset_keys(self): t = cs.group_types.get(1) res = t.unset_keys(['k']) diff --git a/cinderclient/v3/group_types.py b/cinderclient/v3/group_types.py index bab72ac80..1292c1f1d 100644 --- a/cinderclient/v3/group_types.py +++ b/cinderclient/v3/group_types.py @@ -33,6 +33,7 @@ class GroupType(base.Resource): return self._info.get("is_public", self._info.get("is_public", 'N/A')) + @api_versions.wraps("3.11") def get_keys(self): """Get group specs from a group type. @@ -43,6 +44,7 @@ class GroupType(base.Resource): base.getid(self)) return body["group_specs"] + @api_versions.wraps("3.11") def set_keys(self, metadata): """Set group specs on a group type. @@ -56,6 +58,7 @@ class GroupType(base.Resource): "group_specs", return_raw=True) + @api_versions.wraps("3.11") def unset_keys(self, keys): """Unset specs on a group type.