def _AddMockJSONResponseError(mock_client, url):
 def _CreateResponse(request):
  print request
  return httpclient.HTTPResponse(request, 401, headers={'Content-Type': 'application/json'}, buffer=None)
 mock_client.map(url, _CreateResponse)

def _AddMockJSONResponseError ( mock_client , url ) : def _CreateResponse ( request ) : print request return httpclient . HTTPResponse ( request , 401 , headers = { 'Content-Type' : 'application/json' } , buffer = None ) mock_client . map ( url , _CreateResponse )
add a mapping entry to the mock client such that requests to "url" will return an http response containing the json-formatted "response_dict" .