summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Harney <eharney@redhat.com>2013-12-02 18:56:45 -0500
committerEric Harney <eharney@redhat.com>2014-01-27 13:48:12 -0500
commit306d451bc7fc6c33c4aa222582be76c43d835866 (patch)
tree9960e2ed662a3ef6f6b993e40c3e19e3dba5116d
parentdd92af2a9eafa132dd4ce254221180455e8a7349 (diff)
downloadpython-cinderclient-306d451bc7fc6c33c4aa222582be76c43d835866.tar.gz
Add shell tests for snapshot_delete
snapshot_delete does not have a shell test covering it. Closes-Bug: #1257747 Change-Id: I22252f5025c11a7c115aa75e07c78424eec75ba1
-rw-r--r--cinderclient/tests/v1/fakes.py3
-rw-r--r--cinderclient/tests/v1/test_shell.py4
-rw-r--r--cinderclient/tests/v2/fakes.py3
-rw-r--r--cinderclient/tests/v2/test_shell.py4
-rw-r--r--doc/source/index.rst1
5 files changed, 15 insertions, 0 deletions
diff --git a/cinderclient/tests/v1/fakes.py b/cinderclient/tests/v1/fakes.py
index 6fb7f54..648733c 100644
--- a/cinderclient/tests/v1/fakes.py
+++ b/cinderclient/tests/v1/fakes.py
@@ -282,6 +282,9 @@ class FakeHTTPClient(base_client.HTTPClient):
def post_snapshots_5678_action(self, body, **kw):
return self.post_snapshots_1234_action(body, **kw)
+ def delete_snapshots_1234(self, **kw):
+ return (202, {}, {})
+
#
# Volumes
#
diff --git a/cinderclient/tests/v1/test_shell.py b/cinderclient/tests/v1/test_shell.py
index 50293cf..8c2e33d 100644
--- a/cinderclient/tests/v1/test_shell.py
+++ b/cinderclient/tests/v1/test_shell.py
@@ -351,3 +351,7 @@ class ShellTest(utils.TestCase):
self.run_command('service-enable host cinder-volume')
self.assert_called('PUT', '/os-services/enable',
{"binary": "cinder-volume", "host": "host"})
+
+ def test_snapshot_delete(self):
+ self.run_command('snapshot-delete 1234')
+ self.assert_called('DELETE', '/snapshots/1234')
diff --git a/cinderclient/tests/v2/fakes.py b/cinderclient/tests/v2/fakes.py
index 086034a..890fa53 100644
--- a/cinderclient/tests/v2/fakes.py
+++ b/cinderclient/tests/v2/fakes.py
@@ -291,6 +291,9 @@ class FakeHTTPClient(base_client.HTTPClient):
def post_snapshots_5678_action(self, body, **kw):
return self.post_snapshots_1234_action(body, **kw)
+ def delete_snapshots_1234(self, **kw):
+ return (202, {}, {})
+
#
# Volumes
#
diff --git a/cinderclient/tests/v2/test_shell.py b/cinderclient/tests/v2/test_shell.py
index 85a230a..4946ada 100644
--- a/cinderclient/tests/v2/test_shell.py
+++ b/cinderclient/tests/v2/test_shell.py
@@ -341,3 +341,7 @@ class ShellTest(utils.TestCase):
expected = {'os-retype': {'new_type': 'foo',
'migration_policy': 'never'}}
self.assert_called('POST', '/volumes/1234/action', body=expected)
+
+ def test_snapshot_delete(self):
+ self.run_command('snapshot-delete 1234')
+ self.assert_called('DELETE', '/snapshots/1234')
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 6c4df22..f7a6f93 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -46,6 +46,7 @@ MASTER
.. _1264415: http://bugs.launchpad.net/python-cinderclient/+bug/1264415
.. _1258489: http://bugs.launchpad.net/python-cinderclient/+bug/1258489
.. _1248519: http://bugs.launchpad.net/python-cinderclient/+bug/1248519
+.. _1257747: http://bugs.launchpad.net/python-cinderclient/+bug/1257747
1.0.7
-----