Merge "Adds test for HTTPUnprocessableEntity when rebooting"
This commit is contained in:
commit
cc6800e6ab
@ -193,6 +193,18 @@ class ServerActionsControllerTest(test.TestCase):
|
|||||||
self.controller._action_reboot,
|
self.controller._action_reboot,
|
||||||
req, FAKE_UUID, body)
|
req, FAKE_UUID, body)
|
||||||
|
|
||||||
|
def test_reboot_raises_unprocessable_entity(self):
|
||||||
|
body = dict(reboot=dict(type="HARD"))
|
||||||
|
|
||||||
|
def fake_reboot(*args, **kwargs):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
self.stubs.Set(compute_api.API, 'reboot', fake_reboot)
|
||||||
|
req = fakes.HTTPRequest.blank(self.url)
|
||||||
|
self.assertRaises(webob.exc.HTTPUnprocessableEntity,
|
||||||
|
self.controller._action_reboot,
|
||||||
|
req, FAKE_UUID, body)
|
||||||
|
|
||||||
def test_rebuild_accepted_minimum(self):
|
def test_rebuild_accepted_minimum(self):
|
||||||
return_server = fakes.fake_instance_get(image_ref='2',
|
return_server = fakes.fake_instance_get(image_ref='2',
|
||||||
vm_state=vm_states.ACTIVE, host='fake_host')
|
vm_state=vm_states.ACTIVE, host='fake_host')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user