'``keystoneclient.openstack.common.apiclient.exceptions.BadRequest`` is
treated similarly to ``novaclient.exceptions.ClientException``.
See ``test_novaclient_exception``.'

@capture_logging((lambda self, logger: None))
def test_keystone_client_exception(self, logger):

    response = Response()
    response._content = 'hello    world'
    result = KeystoneHttpError(message='Some    things    went    wrong    with    some    other    things.', details={'key': 'value'}, response=response, request_id='abcdefghijklmnopqrstuvwxyz', url='/foo/bar', method='POST', http_status=INTERNAL_SERVER_ERROR)
    logging_dummy = LoggingDummy(Dummy(result))
    self.assertRaises(KeystoneHttpError, logging_dummy.raise_method)
    logged = LoggedMessage.of_type(logger.messages, KEYSTONE_HTTP_ERROR)[0]
    assertContainsFields(self, logged.message, {u'code': result.http_status, u'message': result.message, u'details': result.details, u'request_id': result.request_id, u'url': result.url, u'method': result.method, u'response': 'hello    world'})
