HTTPretty Utility

StackInABox provides support for writing tests with httpretty.

stackinabox.util.httpretty.httpretty_callback(request, uri, headers)

httpretty request handler.

converts a call intercepted by httpretty to the stack-in-a-box infrastructure

Parameters:
  • request – request object
  • uri – the uri of the request
  • headers – headers for the response
Returns:

tuple - (int, dict, string) containing: int - the http response status code dict - the headers for the http response string - http string response

stackinabox.util.httpretty.httpretty_registration(*args, **kwargs)
class stackinabox.util.httpretty.decorator.stack_activate(**kwargs)