summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/v3
diff options
context:
space:
mode:
authorTommyLike <tommylikehu@gmail.com>2018-03-14 15:18:55 +0800
committerTommyLike <tommylikehu@gmail.com>2018-05-02 10:25:27 +0800
commit5a1513244caf7acbd41e181419bc8b62bf4bcaba (patch)
tree139c3b3e71b6eeb6c56006c6e9ae9af56aafa361 /cinderclient/tests/unit/v3
parentbd712fa0cac8ce4cdcd435fb083160be15efb694 (diff)
downloadpython-cinderclient-5a1513244caf7acbd41e181419bc8b62bf4bcaba.tar.gz
Support availability-zone in volume type
Since 3.52, new option '--filters' has been added to 'type-list' command, and it's only valid for administrator. Change-Id: I140f6d61a2747d4fcaabfbccea864dcc7eb841d1 Depends-On: I4e6aa7af707bd063e7edf2b0bf28e3071ad5c67a Partial-Implements: bp support-az-in-volumetype
Diffstat (limited to 'cinderclient/tests/unit/v3')
-rw-r--r--cinderclient/tests/unit/v3/test_shell.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py
index 84ca4cb..cff2145 100644
--- a/cinderclient/tests/unit/v3/test_shell.py
+++ b/cinderclient/tests/unit/v3/test_shell.py
@@ -244,6 +244,20 @@ class ShellTest(utils.TestCase):
self.run_command,
'list --group_id fake_id')
+ def test_type_list_with_filters_invalid(self):
+ self.assertRaises(exceptions.UnsupportedAttribute,
+ self.run_command,
+ '--os-volume-api-version 3.51 type-list '
+ '--filters key=value')
+
+ def test_type_list_with_filters(self):
+ self.run_command('--os-volume-api-version 3.52 type-list '
+ '--filters extra_specs={key:value}')
+ self.assert_called(
+ 'GET', '/types?%s' % parse.urlencode(
+ {'extra_specs':
+ {six.text_type('key'): six.text_type('value')}}))
+
@ddt.data("3.10", "3.11")
def test_list_with_group_id_after_3_10(self, version):
command = ('--os-volume-api-version %s list --group_id fake_id' %