def METHOD_NAME(urllib_req, request_body, mocker):
    opener_mock = mocker.patch('ansible.module_utils.urls.urllib_request._opener')
    handler = RedirectHandlerFactory('all', True)
    inst = handler()
    inst.redirect_request(urllib_req, request_body, 301, '301 Moved Permanently', {}, 'https://docs.ansible.com/')
    assert opener_mock.add_handler.call_count == int(not HAS_SSLCONTEXT)