summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/v3
diff options
context:
space:
mode:
authorTommyLike <tommylikehu@gmail.com>2017-12-04 17:56:25 +0800
committerTommyLike <tommylikehu@gmail.com>2017-12-05 01:15:19 +0000
commita0b18d22a41ed07d34eca66cc7032f414bd38ad0 (patch)
tree63551248f644c3d8e01f022362b1e4ad6b1c41f5 /cinderclient/tests/unit/v3
parentd17ae43e1d01c5c22da3e5290398ecfbc5b3e5bc (diff)
downloadpython-cinderclient-a0b18d22a41ed07d34eca66cc7032f414bd38ad0.tar.gz
Support list with 'with_count' in client
Add 'with_count' parameter in list volume, snapshot and backup APIs. Change-Id: I2b7b41b3579c24703a7a67ab5dc6f960a3ccbdc2 Partial-Implements: bp add-amount-info-in-list-api
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 34cf470..0161987 100644
--- a/cinderclient/tests/unit/v3/test_shell.py
+++ b/cinderclient/tests/unit/v3/test_shell.py
@@ -231,6 +231,10 @@ class ShellTest(utils.TestCase):
# NOTE(jdg): we default to detail currently
self.assert_called('GET', '/volumes/detail')
+ def test_list_with_with_count(self):
+ self.run_command('--os-volume-api-version 3.45 list --with-count')
+ self.assert_called('GET', '/volumes/detail?with_count=True')
+
def test_summary(self):
self.run_command('--os-volume-api-version 3.12 summary')
self.assert_called('GET', '/volumes/summary')
@@ -430,6 +434,11 @@ class ShellTest(utils.TestCase):
expected = {'backup': {'name': 'new_name'}}
self.assert_called('PUT', '/backups/1234', body=expected)
+ def test_backup_list_with_with_count(self):
+ self.run_command(
+ '--os-volume-api-version 3.45 backup-list --with-count')
+ self.assert_called('GET', '/backups/detail?with_count=True')
+
def test_backup_update_with_description(self):
self.run_command('--os-volume-api-version 3.9 '
'backup-update 1234 --description=new-description')
@@ -742,6 +751,11 @@ class ShellTest(utils.TestCase):
expected = {'os-reset_status': expected}
self.assert_called('POST', '/volumes/1234/action', body=expected)
+ def test_snapshot_list_with_with_count(self):
+ self.run_command(
+ '--os-volume-api-version 3.45 snapshot-list --with-count')
+ self.assert_called('GET', '/snapshots/detail?with_count=True')
+
def test_snapshot_list_with_metadata(self):
self.run_command('--os-volume-api-version 3.22 '
'snapshot-list --metadata key1=val1')