def METHOD_NAME(urllib_req, request_body):
    handler = RedirectHandlerFactory('invalid', False)
    inst = handler()
    with pytest.raises(urllib_error.HTTPError):
        inst.redirect_request(urllib_req, request_body, 301, '301 Moved Permanently', {}, 'https://docs.ansible.com/')