summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-15 05:42:04 +0000
committerGerrit Code Review <review@openstack.org>2017-12-15 05:42:04 +0000
commit95e51505e1d2b1ae80d38afe21e9d1330cf0f3f7 (patch)
treee6a6ce6023f5bbda8b7beec743c0786058770239 /cinderclient/tests/unit
parent2a478b3528e9acb59d65f4fda8ed647a749f6021 (diff)
parent9bfd6da08d615e56385df990b72cd0b891ed8868 (diff)
downloadpython-cinderclient-95e51505e1d2b1ae80d38afe21e9d1330cf0f3f7.tar.gz
Merge "Backup create is not available from 3.0 to 3.42"
Diffstat (limited to 'cinderclient/tests/unit')
-rw-r--r--cinderclient/tests/unit/v3/test_shell.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py
index 2492cda..638e960 100644
--- a/cinderclient/tests/unit/v3/test_shell.py
+++ b/cinderclient/tests/unit/v3/test_shell.py
@@ -1035,13 +1035,31 @@ class ShellTest(utils.TestCase):
mock_time.sleep.call_args_list)
self.assertEqual([mock.call(some_id)] * 2, poll_fn.call_args_list)
+ def test_backup(self):
+ self.run_command('--os-volume-api-version 3.42 backup-create '
+ '--name 1234 1234')
+ expected = {'backup': {'volume_id': 1234,
+ 'container': None,
+ 'name': '1234',
+ 'description': None,
+ 'incremental': False,
+ 'force': False,
+ 'snapshot_id': None,
+ }}
+ self.assert_called('POST', '/backups', body=expected)
+
def test_backup_with_metadata(self):
- cmd = '--os-volume-api-version 3.43 '
- cmd += 'backup-create '
- cmd += '--metadata foo=bar '
- cmd += '1234'
- self.run_command(cmd)
- self.assert_called('POST', '/backups')
+ self.run_command('--os-volume-api-version 3.43 backup-create '
+ '--metadata foo=bar --name 1234 1234')
+ expected = {'backup': {'volume_id': 1234,
+ 'container': None,
+ 'name': '1234',
+ 'description': None,
+ 'incremental': False,
+ 'force': False,
+ 'snapshot_id': None,
+ 'metadata': {'foo': 'bar'}, }}
+ self.assert_called('POST', '/backups', body=expected)
@mock.patch("cinderclient.utils.print_list")
def test_snapshot_list_with_userid(self, mock_print_list):