summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorzhiyong.dai <zhiyong.dai@easystack.cn>2016-12-19 18:50:08 +0800
committerzhiyong.dai <zhiyong.dai@easystack.cn>2016-12-19 18:50:08 +0800
commit20b0b71809e7d9aaf82b07acac10f1d3f08c48a3 (patch)
tree898a3e495305f7e4501396b55122a6dfee5648a9 /openstackclient/tests
parente51a2b3b171f3c72a715bee3ad99c0f88efa3010 (diff)
downloadpython-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.py24
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',