summaryrefslogtreecommitdiff
path: root/cinderclient/tests
diff options
context:
space:
mode:
authorj-griffith <john.griffith8@gmail.com>2017-09-07 23:29:55 +0000
committerJohn Griffith <john.griffith8@gmail.com>2017-09-21 10:18:58 -0600
commit3d1225cbb0435c9912ff1359f2db07ae4e6c81eb (patch)
tree548f41f1d74ae5201e10ad4927809c94892f6c6f /cinderclient/tests
parent3869163aa9c9ba43d947b49578a5c06bd26ab40e (diff)
downloadpython-cinderclient-3d1225cbb0435c9912ff1359f2db07ae4e6c81eb.tar.gz
Implement UserID in snapshot list response
We have a gap in the microversions implemented in the cinderclient and the MAX version being reported by the client. One of those is the addition of "user_id" in the snapshot list response. This patch adds that with the appropriate version checking. Note that the Max version has already been updated, but there are a few implementations missing. Change-Id: Ia8bdb46b46091a89996e404825466430b8906d18 Partial-Bug: #1715759
Diffstat (limited to 'cinderclient/tests')
-rw-r--r--cinderclient/tests/unit/v3/test_shell.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py
index ccfb45b..87567dc 100644
--- a/cinderclient/tests/unit/v3/test_shell.py
+++ b/cinderclient/tests/unit/v3/test_shell.py
@@ -998,3 +998,12 @@ class ShellTest(utils.TestCase):
cmd += '1234'
self.run_command(cmd)
self.assert_called('POST', '/backups')
+
+ @mock.patch("cinderclient.utils.print_list")
+ def test_snapshot_list_with_userid(self, mock_print_list):
+ """Ensure 3.41 provides User ID header."""
+ self.run_command('--os-volume-api-version 3.41 snapshot-list')
+ self.assert_called('GET', '/snapshots/detail')
+ columns = ['ID', 'Volume ID', 'Status', 'Name', 'Size', 'User ID']
+ mock_print_list.assert_called_once_with(mock.ANY, columns,
+ sortby_index=0)