Add shell tests for snapshot_delete

snapshot_delete does not have a shell test covering it.

Closes-Bug: #1257747

Change-Id: I22252f5025c11a7c115aa75e07c78424eec75ba1
This commit is contained in:
Eric Harney 2013-12-02 18:56:45 -05:00
parent dd92af2a9e
commit 306d451bc7
5 changed files with 15 additions and 0 deletions

@ -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
#

@ -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')

@ -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
#

@ -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')

@ -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
-----