def request_with(authfunc, auth_header): harness.client.website.algorithm.insert_after( 'parse_environ_into_request' , inbound_responder(authfunc) ) return harness.simple( filepath=None , return_after='httpbasic_inbound_responder' , want='request' , HTTP_AUTHORIZATION=auth_header )
def _request_with(authfunc, auth_header): request = StubRequest() if auth_header is not None: request.headers['Authorization'] = auth_header hook = inbound_responder(authfunc) return hook(request)