diff options
| author | zhiyong.dai <zhiyong.dai@easystack.cn> | 2016-12-19 18:50:08 +0800 |
|---|---|---|
| committer | zhiyong.dai <zhiyong.dai@easystack.cn> | 2016-12-19 18:50:08 +0800 |
| commit | 20b0b71809e7d9aaf82b07acac10f1d3f08c48a3 (patch) | |
| tree | 898a3e495305f7e4501396b55122a6dfee5648a9 /openstackclient/tests | |
| parent | e51a2b3b171f3c72a715bee3ad99c0f88efa3010 (diff) | |
| download | python-openstackclient-20b0b71809e7d9aaf82b07acac10f1d3f08c48a3.tar.gz | |
Add one test for "backup set" command
The former tests for "backup set" command miss a test for '--description'
option. In this patch, one relative test is added.
Change-Id: Ie755d56a68a666d48751ab1ad20c8edb50e69b94
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/unit/volume/v2/test_backup.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/volume/v2/test_backup.py b/openstackclient/tests/unit/volume/v2/test_backup.py index 10e7aac5..a8e81c7e 100644 --- a/openstackclient/tests/unit/volume/v2/test_backup.py +++ b/openstackclient/tests/unit/volume/v2/test_backup.py @@ -418,6 +418,30 @@ class TestBackupSet(TestBackup): self.backup.id, **{'name': 'new_name'}) self.assertIsNone(result) + def test_backup_set_description(self): + arglist = [ + '--description', 'new_description', + self.backup.id, + ] + verifylist = [ + ('name', None), + ('description', 'new_description'), + ('backup', self.backup.id), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + # Set expected values + kwargs = { + 'description': 'new_description' + } + self.backups_mock.update.assert_called_once_with( + self.backup.id, + **kwargs + ) + self.assertIsNone(result) + def test_backup_set_state(self): arglist = [ '--state', 'error', |
