From d75c854f191af8b87e99028270281cad8822edc6 Mon Sep 17 00:00:00 2001 From: Dave Hunt Date: Wed, 27 Jan 2016 18:23:03 +0000 Subject: [PATCH 1/3] Add URL tests that follow redirects and allow these to be run from the build pipeline --- ...onal-tests.sh => run-integration-tests.sh} | 2 +- ...tional_tests => bedrock_integration_tests} | 4 +- ...onal_tests.sh => run_integration_tests.sh} | 75 +++++++++--------- tests/redirects/base.py | 23 ++++-- tests/redirects/map_globalconf.py | 6 +- tests/redirects/test_redirects.py | 45 +++++++++++ tests/redirects/test_urls.py | 77 +++++++++++-------- 7 files changed, 153 insertions(+), 79 deletions(-) rename bin/{run-functional-tests.sh => run-integration-tests.sh} (98%) rename docker/dockerfiles/{bedrock_functional_tests => bedrock_integration_tests} (89%) rename docker/jenkins/{run_functional_tests.sh => run_integration_tests.sh} (51%) create mode 100644 tests/redirects/test_redirects.py diff --git a/bin/run-functional-tests.sh b/bin/run-integration-tests.sh similarity index 98% rename from bin/run-functional-tests.sh rename to bin/run-integration-tests.sh index 250c08addf6..f8bf4b715ad 100755 --- a/bin/run-functional-tests.sh +++ b/bin/run-integration-tests.sh @@ -11,7 +11,7 @@ set -xe : ${SELENIUM_HOST:="localhost"} : ${SELENIUM_PORT:="4444"} : ${BROWSER_NAME:="firefox"} -: ${TESTS_PATH:="tests/functional"} +: ${TESTS_PATH:="tests"} : ${RESULTS_PATH:="${TESTS_PATH}/results"} # Common arguments diff --git a/docker/dockerfiles/bedrock_functional_tests b/docker/dockerfiles/bedrock_integration_tests similarity index 89% rename from docker/dockerfiles/bedrock_functional_tests rename to docker/dockerfiles/bedrock_integration_tests index 3ce377b4e6a..7966f82e90b 100644 --- a/docker/dockerfiles/bedrock_functional_tests +++ b/docker/dockerfiles/bedrock_integration_tests @@ -2,7 +2,7 @@ FROM debian:jessie WORKDIR /app # Run the tests -CMD ["/app/bin/run-functional-tests.sh"] +CMD ["/app/bin/run-integration-tests.sh"] RUN apt-get update && \ @@ -11,7 +11,7 @@ RUN apt-get update && \ # Defaults ENV PYTEST_PROCESSES 5 ENV PRIVACY "public restricted" -ENV TESTS_PATH /app/tests/functional +ENV TESTS_PATH /app/tests ENV RESULTS_PATH /app/results ENV PYTHONDONTWRITEBYTECODE=1 diff --git a/docker/jenkins/run_functional_tests.sh b/docker/jenkins/run_integration_tests.sh similarity index 51% rename from docker/jenkins/run_functional_tests.sh rename to docker/jenkins/run_integration_tests.sh index 827c8469c84..5aaf1940d32 100755 --- a/docker/jenkins/run_functional_tests.sh +++ b/docker/jenkins/run_integration_tests.sh @@ -1,7 +1,21 @@ #!/bin/bash -xe GIT_COMMIT=${GIT_COMMIT:-$(git rev-parse HEAD)} -cp docker/dockerfiles/bedrock_functional_tests Dockerfile -docker build -t bedrock_functional_tests:${GIT_COMMIT} --pull=true . +cp docker/dockerfiles/bedrock_integration_tests Dockerfile +docker build -t bedrock_integration_tests:${GIT_COMMIT} --pull=true . + +if [ -z "${BASE_URL}" ]; then + # start bedrock + docker run -d \ + --name bedrock-code-${BUILD_NUMBER} \ + -e ALLOWED_HOSTS="*" \ + -e SECRET_KEY=foo \ + -e DEBUG=False \ + -e DATABASE_URL=sqlite:////tmp/temp.db \ + mozorg/bedrock_code:${GIT_COMMIT} + + DOCKER_LINKS=(--link bedrock-code-${BUILD_NUMBER}:bedrock) + BASE_URL="http://bedrock:8000" +fi if [ "${DRIVER}" = "Remote" ]; then # Start Selenium hub and NUMBER_OF_NODES (default 5) firefox nodes. @@ -13,26 +27,18 @@ if [ "${DRIVER}" = "Remote" ]; then docker pull selenium/hub:${SELENIUM_VERSION} docker pull selenium/node-firefox:${SELENIUM_VERSION} - # start bedrock - docker run -d \ - --name bedrock-code-${BUILD_NUMBER} \ - -e ALLOWED_HOSTS="*" \ - -e SECRET_KEY=foo \ - -e DEBUG=False \ - -e DATABASE_URL=sqlite:////tmp/temp.db \ - mozorg/bedrock_code:$GIT_COMMIT - # start selenium grid hub docker run -d \ --name bedrock-selenium-hub-${BUILD_NUMBER} \ selenium/hub:${SELENIUM_VERSION} + DOCKER_LINKS=(${DOCKER_LINKS[@]} --link bedrock-selenium-hub-${BUILD_NUMBER}:hub) + SELENIUM_HOST="hub" # start selenium grid nodes for NODE_NUMBER in `seq ${NUMBER_OF_NODES:-5}`; do docker run -d \ --name bedrock-selenium-node-${NODE_NUMBER}-${BUILD_NUMBER} \ - --link bedrock-selenium-hub-${BUILD_NUMBER}:hub \ - --link bedrock-code-${BUILD_NUMBER}:bedrock \ + ${DOCKER_LINKS[@]} \ selenium/node-firefox:${SELENIUM_VERSION} while ! ${SELENIUM_READY}; do IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' bedrock-selenium-node-${NODE_NUMBER}-${BUILD_NUMBER}` @@ -40,29 +46,22 @@ if [ "${DRIVER}" = "Remote" ]; then if eval ${CMD}; then SELENIUM_READY=true; fi done done - - docker run -v `pwd`/results:/app/results \ - --link bedrock-selenium-hub-${BUILD_NUMBER}:hub \ - --link bedrock-code-${BUILD_NUMBER}:bedrock \ - -e BASE_URL=http://bedrock:8000 \ - -e DRIVER=${DRIVER} \ - -e SELENIUM_HOST=hub \ - -e MARK_EXPRESSION=${MARK_EXPRESSION} \ - bedrock_functional_tests:$GIT_COMMIT -else - # Runs functional tests that either don't require Selenium, use a local - # Selenium driver, or use a remote Selenium server (such as Sauce Labs). - docker run -v `pwd`/results:/app/results \ - -e BASE_URL=${BASE_URL} \ - -e DRIVER=${DRIVER} \ - -e SAUCELABS_USERNAME=${SAUCELABS_USERNAME} \ - -e SAUCELABS_API_KEY=${SAUCELABS_API_KEY} \ - -e BROWSER_NAME="${BROWSER_NAME}" \ - -e BROWSER_VERSION=${BROWSER_VERSION} \ - -e PLATFORM="${PLATFORM}" \ - -e SELENIUM_VERSION=${SELENIUM_VERSION} \ - -e BUILD_TAG=${BUILD_TAG} \ - -e SCREEN_RESOLUTION=${SCREEN_RESOLUTION} \ - -e MARK_EXPRESSION="${MARK_EXPRESSION}" \ - bedrock_functional_tests:${GIT_COMMIT} fi + +docker run -v `pwd`/results:/app/results \ + ${DOCKER_LINKS[@]} \ + -e BASE_URL=${BASE_URL} \ + -e DRIVER=${DRIVER} \ + -e SAUCELABS_USERNAME=${SAUCELABS_USERNAME} \ + -e SAUCELABS_API_KEY=${SAUCELABS_API_KEY} \ + -e BROWSER_NAME="${BROWSER_NAME}" \ + -e BROWSER_VERSION=${BROWSER_VERSION} \ + -e PLATFORM="${PLATFORM}" \ + -e SELENIUM_HOST=${SELENIUM_HOST} \ + -e SELENIUM_PORT=${SELENIUM_PORT} \ + -e SELENIUM_VERSION=${SELENIUM_VERSION} \ + -e BUILD_TAG=${BUILD_TAG} \ + -e SCREEN_RESOLUTION=${SCREEN_RESOLUTION} \ + -e MARK_EXPRESSION="${MARK_EXPRESSION}" \ + -e TESTS_PATH="${TESTS_PATH}" \ + bedrock_integration_tests:${GIT_COMMIT} diff --git a/tests/redirects/base.py b/tests/redirects/base.py index dba66c711fe..d532741f57c 100644 --- a/tests/redirects/base.py +++ b/tests/redirects/base.py @@ -18,7 +18,8 @@ def get_abs_url(url, base_url): def url_test(url, location=None, status_code=requests.codes.moved_permanently, - req_headers=None, req_kwargs=None, resp_headers=None, query=None): + req_headers=None, req_kwargs=None, resp_headers=None, query=None, + allow_redirects=False, final_status_code=requests.codes.ok): """ Function for producing a config dict for the redirect test. @@ -46,6 +47,8 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, :param req_kwargs: Extra arguments to pass to requests.get() :param resp_headers: Dict of headers expected in the response. :param query: Dict of expected query params in `location` URL. + :param allow_redirects: Boolean indicating whether redirects should be followed. + :param final_status_code: Expected status code after following any redirects. :return: dict or list of dicts """ test_data = { @@ -56,6 +59,8 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, 'req_kwargs': req_kwargs, 'resp_headers': resp_headers, 'query': query, + 'allow_redirects': allow_redirects, + 'final_status_code': final_status_code, } expanded_urls = list(braceexpand(url)) num_urls = len(expanded_urls) @@ -90,7 +95,8 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, def assert_valid_url(url, location=None, status_code=requests.codes.moved_permanently, req_headers=None, req_kwargs=None, resp_headers=None, - query=None, base_url=None): + query=None, base_url=None, allow_redirects=False, + final_status_code=requests.codes.ok): """ Define a test of a URL's response. :param url: The URL in question (absolute or relative). @@ -101,8 +107,10 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman :param resp_headers: Dict of headers expected in the response. :param base_url: Base URL for the site to test. :param query: Dict of expected query params in `location` URL. + :param allow_redirects: Boolean indicating whether redirects should be followed. + :param final_status_code: Expected status code after following any redirects. """ - kwargs = {'allow_redirects': False} + kwargs = {'allow_redirects': allow_redirects} if req_headers: kwargs['headers'] = req_headers if req_kwargs: @@ -112,8 +120,11 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman resp = requests.get(abs_url, **kwargs) # so that the value will appear in locals in test output resp_location = resp.headers.get('location') - assert resp.status_code == status_code - if location: + if allow_redirects: + assert resp.status_code == final_status_code + else: + assert resp.status_code == status_code + if location and not allow_redirects: if query: # all query values must be lists for k, v in query.items(): @@ -133,7 +144,7 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman except AttributeError: assert abs_location == resp_location - if resp_headers: + if resp_headers and not allow_redirects: for name, value in resp_headers.items(): print name, value assert name in resp.headers diff --git a/tests/redirects/map_globalconf.py b/tests/redirects/map_globalconf.py index e424ee37717..b267f9240da 100644 --- a/tests/redirects/map_globalconf.py +++ b/tests/redirects/map_globalconf.py @@ -194,7 +194,7 @@ # bug 860865, 1101220 url_test('/firefox/all-{beta,rc}{/,.html}', '/firefox/beta/all/'), url_test('/firefox/all-aurora{/,.html}', '/firefox/developer/all/'), - url_test('/firefox/aurora/{all,notes,system-requirements}/' + url_test('/firefox/aurora/{all,notes,system-requirements}/', '/firefox/developer/{all,notes,system-requirements}/'), url_test('/firefox/organizations/all.html', '/firefox/organizations/all/'), @@ -988,4 +988,8 @@ # Bug 1239863 url_test('/firefox/os/faq/', 'https://support.mozilla.org/products/firefox-os'), + + url_test('/firefox/brand/', '/styleguide/'), + url_test('/firefox/channel/android/', '/en-US/firefox/channel/android/'), + url_test('/en-US/firefox/channel/android/', '/firefox/channel/'), )) diff --git a/tests/redirects/test_redirects.py b/tests/redirects/test_redirects.py new file mode 100644 index 00000000000..ace43de44c0 --- /dev/null +++ b/tests/redirects/test_redirects.py @@ -0,0 +1,45 @@ +"""Test redirects from the global.conf file.""" +from __future__ import absolute_import +from operator import itemgetter + +import pytest + +from .base import assert_valid_url +from .map_htaccess import URLS as HTA_URLS +from .map_globalconf import URLS as GLOBAL_URLS +from .map_external import URLS as EXTERNAL_URLS +from .map_locales import URLS as LOCALE_URLS + + +@pytest.mark.smoke +@pytest.mark.headless +@pytest.mark.nondestructive +@pytest.mark.parametrize('url', GLOBAL_URLS, ids=itemgetter('url')) +def test_global_conf_url(url, base_url): + url['base_url'] = base_url + assert_valid_url(**url) + + +@pytest.mark.smoke +@pytest.mark.headless +@pytest.mark.nondestructive +@pytest.mark.parametrize('url', HTA_URLS, ids=itemgetter('url')) +def test_htaccess_url(url, base_url): + url['base_url'] = base_url + assert_valid_url(**url) + + +@pytest.mark.smoke +@pytest.mark.headless +@pytest.mark.nondestructive +@pytest.mark.parametrize('url', LOCALE_URLS) +def test_locale_url(url, base_url): + url['base_url'] = base_url + assert_valid_url(**url) + + +@pytest.mark.headless +@pytest.mark.nondestructive +@pytest.mark.parametrize('url', EXTERNAL_URLS, ids=itemgetter('url')) +def test_external_url(url): + assert_valid_url(**url) diff --git a/tests/redirects/test_urls.py b/tests/redirects/test_urls.py index 48a581298a9..9cd00d2730b 100644 --- a/tests/redirects/test_urls.py +++ b/tests/redirects/test_urls.py @@ -7,43 +7,15 @@ from .base import assert_valid_url from .map_410 import URLS_410 -from .map_htaccess import URLS as HTA_URLS -from .map_globalconf import URLS as GLOBAL_URLS from .map_external import URLS as EXTERNAL_URLS -from .map_locales import URLS as LOCALE_URLS - - -@pytest.mark.smoke -@pytest.mark.headless -@pytest.mark.nondestructive -@pytest.mark.parametrize('url', GLOBAL_URLS, ids=itemgetter('url')) -def test_global_conf_url(url, base_url): - url['base_url'] = base_url - assert_valid_url(**url) - - -@pytest.mark.smoke -@pytest.mark.headless -@pytest.mark.nondestructive -@pytest.mark.parametrize('url', HTA_URLS, ids=itemgetter('url')) -def test_htaccess_url(url, base_url): - url['base_url'] = base_url - assert_valid_url(**url) - - -@pytest.mark.smoke -@pytest.mark.headless -@pytest.mark.nondestructive -@pytest.mark.parametrize('url', LOCALE_URLS) -def test_locale_url(url, base_url): - url['base_url'] = base_url - assert_valid_url(**url) @pytest.mark.headless @pytest.mark.nondestructive @pytest.mark.parametrize('url', EXTERNAL_URLS, ids=itemgetter('url')) def test_external_url(url): + del url['location'] + url['allow_redirects'] = True assert_valid_url(**url) @@ -52,7 +24,7 @@ def test_external_url(url): @pytest.mark.nondestructive @pytest.mark.parametrize('url', URLS_410) def test_410_url(url, base_url): - assert_valid_url(url, status_code=requests.codes.gone, base_url=base_url) + assert_valid_url(url, base_url=base_url, status_code=requests.codes.gone) @pytest.mark.smoke @@ -70,3 +42,46 @@ def test_404_url(base_url): @pytest.mark.nondestructive def test_x_robots_tag(base_url): assert_valid_url(base_url, resp_headers={'x-robots-tag': 'noodp'}) + + +@pytest.mark.headless +@pytest.mark.nondestructive +@pytest.mark.parametrize('url', [ + '/firefox/', + '/firefox/all/', + '/firefox/android/', + '/firefox/android/faq/', + '/firefox/aurora/all/', + '/firefox/beta/all/', + '/firefox/brand/', + '/firefox/channel/', + '/firefox/channel/android/', + '/firefox/desktop/', + '/firefox/developer/', + '/firefox/geolocation/', + '/firefox/installer-help/', + '/firefox/interest-dashboard/', + '/firefox/latest/releasenotes/', + '/firefox/mobile/', + '/firefox/new/', + '/firefox/nightly/firstrun/', + '/firefox/organizations/', + '/firefox/os/', + '/firefox/os/notes/1.1/', + '/firefox/partners/', + '/firefox/releases/', + '/firefox/speed/', + '/firefox/sync/', + '/firefox/tiles/', + '/firefox/unsupported-systems/', + '/firefox/unsupported/EOL/', + # Legacy URLs (Bug 1110927) + 'firefox/panorama/', + 'firefox/start/central.html', + 'firefox/sync/firstrun.html', + # Thunberbird URLs + 'thunderbird/all/', + 'thunderbird/releases/' +]) +def test_url(url, base_url): + assert_valid_url(url, base_url=base_url, allow_redirects=True) From 93180e91de5c1e6b43199ae11bcff49de7b61d19 Mon Sep 17 00:00:00 2001 From: Dave Hunt Date: Wed, 10 Feb 2016 19:58:08 +0000 Subject: [PATCH 2/3] Address review comments --- tests/redirects/base.py | 18 +++++++++--------- tests/redirects/map_globalconf.py | 3 +++ tests/redirects/test_urls.py | 10 +++++----- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/redirects/base.py b/tests/redirects/base.py index d532741f57c..2ac144cc2d5 100644 --- a/tests/redirects/base.py +++ b/tests/redirects/base.py @@ -19,7 +19,7 @@ def get_abs_url(url, base_url): def url_test(url, location=None, status_code=requests.codes.moved_permanently, req_headers=None, req_kwargs=None, resp_headers=None, query=None, - allow_redirects=False, final_status_code=requests.codes.ok): + follow_redirects=False, final_status_code=requests.codes.ok): """ Function for producing a config dict for the redirect test. @@ -47,7 +47,7 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, :param req_kwargs: Extra arguments to pass to requests.get() :param resp_headers: Dict of headers expected in the response. :param query: Dict of expected query params in `location` URL. - :param allow_redirects: Boolean indicating whether redirects should be followed. + :param follow_redirects: Boolean indicating whether redirects should be followed. :param final_status_code: Expected status code after following any redirects. :return: dict or list of dicts """ @@ -59,7 +59,7 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, 'req_kwargs': req_kwargs, 'resp_headers': resp_headers, 'query': query, - 'allow_redirects': allow_redirects, + 'allow_redirects': follow_redirects, 'final_status_code': final_status_code, } expanded_urls = list(braceexpand(url)) @@ -95,7 +95,7 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, def assert_valid_url(url, location=None, status_code=requests.codes.moved_permanently, req_headers=None, req_kwargs=None, resp_headers=None, - query=None, base_url=None, allow_redirects=False, + query=None, base_url=None, follow_redirects=False, final_status_code=requests.codes.ok): """ Define a test of a URL's response. @@ -107,10 +107,10 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman :param resp_headers: Dict of headers expected in the response. :param base_url: Base URL for the site to test. :param query: Dict of expected query params in `location` URL. - :param allow_redirects: Boolean indicating whether redirects should be followed. + :param follow_redirects: Boolean indicating whether redirects should be followed. :param final_status_code: Expected status code after following any redirects. """ - kwargs = {'allow_redirects': allow_redirects} + kwargs = {'allow_redirects': follow_redirects} if req_headers: kwargs['headers'] = req_headers if req_kwargs: @@ -120,11 +120,11 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman resp = requests.get(abs_url, **kwargs) # so that the value will appear in locals in test output resp_location = resp.headers.get('location') - if allow_redirects: + if follow_redirects: assert resp.status_code == final_status_code else: assert resp.status_code == status_code - if location and not allow_redirects: + if location and not follow_redirects: if query: # all query values must be lists for k, v in query.items(): @@ -144,7 +144,7 @@ def assert_valid_url(url, location=None, status_code=requests.codes.moved_perman except AttributeError: assert abs_location == resp_location - if resp_headers and not allow_redirects: + if resp_headers and not follow_redirects: for name, value in resp_headers.items(): print name, value assert name in resp.headers diff --git a/tests/redirects/map_globalconf.py b/tests/redirects/map_globalconf.py index b267f9240da..b9c124575ec 100644 --- a/tests/redirects/map_globalconf.py +++ b/tests/redirects/map_globalconf.py @@ -980,6 +980,9 @@ url_test('/en-US/firefox/notes/', re.compile(r'/en-US/firefox/[\d\.]+/releasenotes/'), status_code=requests.codes.found), + url_test('/firefox/brand/', '/styleguide/'), + url_test('/firefox/channel/android/', '/en-US/firefox/channel/android/'), + url_test('/en-US/firefox/channel/android/', '/firefox/channel/'), # Bug 1243060 url_test('/firefox/tiles/', diff --git a/tests/redirects/test_urls.py b/tests/redirects/test_urls.py index 9cd00d2730b..83ed681fb81 100644 --- a/tests/redirects/test_urls.py +++ b/tests/redirects/test_urls.py @@ -76,12 +76,12 @@ def test_x_robots_tag(base_url): '/firefox/unsupported-systems/', '/firefox/unsupported/EOL/', # Legacy URLs (Bug 1110927) - 'firefox/panorama/', - 'firefox/start/central.html', - 'firefox/sync/firstrun.html', + '/firefox/panorama/', + '/firefox/start/central.html', + '/firefox/sync/firstrun.html', # Thunberbird URLs - 'thunderbird/all/', - 'thunderbird/releases/' + '/thunderbird/all/', + '/thunderbird/releases/' ]) def test_url(url, base_url): assert_valid_url(url, base_url=base_url, allow_redirects=True) From 3ff957e8f280c0e3b0ea01492581c996542a160b Mon Sep 17 00:00:00 2001 From: Dave Hunt Date: Fri, 12 Feb 2016 09:10:06 +0000 Subject: [PATCH 3/3] s/allow_redirects/follow_redirects --- tests/redirects/base.py | 2 +- tests/redirects/map_globalconf.py | 4 ---- tests/redirects/test_urls.py | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/redirects/base.py b/tests/redirects/base.py index 2ac144cc2d5..566047384ed 100644 --- a/tests/redirects/base.py +++ b/tests/redirects/base.py @@ -59,7 +59,7 @@ def url_test(url, location=None, status_code=requests.codes.moved_permanently, 'req_kwargs': req_kwargs, 'resp_headers': resp_headers, 'query': query, - 'allow_redirects': follow_redirects, + 'follow_redirects': follow_redirects, 'final_status_code': final_status_code, } expanded_urls = list(braceexpand(url)) diff --git a/tests/redirects/map_globalconf.py b/tests/redirects/map_globalconf.py index b9c124575ec..3eb1c6513bf 100644 --- a/tests/redirects/map_globalconf.py +++ b/tests/redirects/map_globalconf.py @@ -991,8 +991,4 @@ # Bug 1239863 url_test('/firefox/os/faq/', 'https://support.mozilla.org/products/firefox-os'), - - url_test('/firefox/brand/', '/styleguide/'), - url_test('/firefox/channel/android/', '/en-US/firefox/channel/android/'), - url_test('/en-US/firefox/channel/android/', '/firefox/channel/'), )) diff --git a/tests/redirects/test_urls.py b/tests/redirects/test_urls.py index 83ed681fb81..2164f5a49fa 100644 --- a/tests/redirects/test_urls.py +++ b/tests/redirects/test_urls.py @@ -15,7 +15,7 @@ @pytest.mark.parametrize('url', EXTERNAL_URLS, ids=itemgetter('url')) def test_external_url(url): del url['location'] - url['allow_redirects'] = True + url['follow_redirects'] = True assert_valid_url(**url) @@ -84,4 +84,4 @@ def test_x_robots_tag(base_url): '/thunderbird/releases/' ]) def test_url(url, base_url): - assert_valid_url(url, base_url=base_url, allow_redirects=True) + assert_valid_url(url, base_url=base_url, follow_redirects=True)