diff options
| author | Zuul <zuul@review.opendev.org> | 2019-09-11 20:29:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-09-11 20:29:58 +0000 |
| commit | a63d4d651ae2f7614224f716b3ef8ebf392a6b78 (patch) | |
| tree | 0c939c22069ccde2d24d50c91eb75989d4d2d442 /cinderclient/tests/unit/v2/test_shell.py | |
| parent | d83998f6f0c18787a99ae189a4429fc142d8533a (diff) | |
| parent | 246040a7325164eb0c7c3171dd21ceb7c7d149ce (diff) | |
| download | python-cinderclient-5.0.0.tar.gz | |
Merge "Drop support for --sort_key and --sort_dir"5.0.0
Diffstat (limited to 'cinderclient/tests/unit/v2/test_shell.py')
| -rw-r--r-- | cinderclient/tests/unit/v2/test_shell.py | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py index 22cb25e..a610753 100644 --- a/cinderclient/tests/unit/v2/test_shell.py +++ b/cinderclient/tests/unit/v2/test_shell.py @@ -219,37 +219,11 @@ class ShellTest(utils.TestCase): mock_print.assert_called_once_with(mock.ANY, key_list, exclude_unavailable=True, sortby_index=0) - def test_list_sort_valid(self): - self.run_command('list --sort_key=id --sort_dir=asc') - self.assert_called('GET', '/volumes/detail?sort_dir=asc&sort_key=id') - - def test_list_sort_key_name(self): - # Client 'name' key is mapped to 'display_name' - self.run_command('list --sort_key=name') - self.assert_called('GET', '/volumes/detail?sort_key=display_name') - def test_list_sort_name(self): # Client 'name' key is mapped to 'display_name' self.run_command('list --sort=name') self.assert_called('GET', '/volumes/detail?sort=display_name') - def test_list_sort_key_invalid(self): - self.assertRaises(ValueError, - self.run_command, - 'list --sort_key=foo --sort_dir=asc') - - def test_list_sort_dir_invalid(self): - self.assertRaises(ValueError, - self.run_command, - 'list --sort_key=id --sort_dir=foo') - - def test_list_mix_sort_args(self): - cmds = ['list --sort name:desc --sort_key=status', - 'list --sort name:desc --sort_dir=asc', - 'list --sort name:desc --sort_key=status --sort_dir=asc'] - for cmd in cmds: - self.assertRaises(exceptions.CommandError, self.run_command, cmd) - def test_list_sort_single_key_only(self): self.run_command('list --sort=id') self.assert_called('GET', '/volumes/detail?sort=id') @@ -277,10 +251,7 @@ class ShellTest(utils.TestCase): def test_list_reorder_with_sort(self): # sortby_index is None if there is sort information - for cmd in ['list --sort_key=name', - 'list --sort_dir=asc', - 'list --sort_key=name --sort_dir=asc', - 'list --sort=name', + for cmd in ['list --sort=name', 'list --sort=name:asc']: with mock.patch('cinderclient.utils.print_list') as mock_print: self.run_command(cmd) |
