def test_invalid_action(self):
    body = dict(blah=dict(name='test'))
    url = '/fake/servers/abcd/action'
    response = self._send_server_action_request(url, body)
    self.assertEqual(400, response.status_int)
    self.assertEqual('application/json', response.content_type)
    body = jsonutils.loads(response.body)
    expected = {'badRequest': {'message': 'There is no such action: blah', 'code': 400}}
    self.assertDictMatch(expected, body)
def test_invalid_action(self):
    body = dict(blah=dict(name='test'))
    url = '/fake/servers/abcd/action'
    response = self._send_server_action_request(url, body)
    self.assertEqual(400, response.status_int)
    self.assertEqual('application/json', response.content_type)
    body = jsonutils.loads(response.body)
    expected = {'badRequest': {'message': 'There is no such action: blah', 'code': 400}}
    self.assertDictMatch(expected, body)