Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4765 from escattone/cdn-headless-tests-1431259
Browse files Browse the repository at this point in the history
bug 1431259: add headless tests for cdn
  • Loading branch information
jwhitlock committed May 8, 2018
2 parents 74c7c12 + 9580b43 commit 907c7ec
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 3 deletions.
9 changes: 6 additions & 3 deletions requirements/constraints.txt
Expand Up @@ -14,9 +14,12 @@ py==1.4.33 \
--hash=sha256:81b5e37db3cc1052de438375605fb5d3b3e97f950f415f9143f04697c684d7eb \
--hash=sha256:1f9a981438f2acc20470b301a07a496375641f902320f70e31916fe3377385a9
# pytest plugins
pytest==3.0.7 \
--hash=sha256:66f332ae62593b874a648b10a8cb106bfdacd2c6288ed7dec3713c3a808a6017 \
--hash=sha256:b70696ebd1a5e6b627e7e3ac1365a4bc60aaf3495e843c1e70448966c5224cab
# Code: https://github.com/pytest-dev/pytest
# Changes: https://docs.pytest.org/en/latest/changelog.html
# Docs: https://docs.pytest.org/en/latest/
pytest==3.1.3 \
--hash=sha256:2a4f483468954621fcc8f74784f3b42531e5b5008d49fc609b37bc4dbc6dead1 \
--hash=sha256:095e1832f7e424563c95daf4d8d3c865052b80e139cdd2f9610a986ee8526206
# babel, celery, django-sundial
pytz==2017.3 \
--hash=sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48 \
Expand Down
11 changes: 11 additions & 0 deletions tests/conftest.py
Expand Up @@ -48,6 +48,7 @@ def pytest_configure(config):
headers={'Accept': 'application/json'})
response.raise_for_status()
_KUMA_STATUS = response.json()
_KUMA_STATUS['response'] = {'headers': response.headers}
config._metadata['kuma'] = _KUMA_STATUS

# Process the settings for this Kuma instance
Expand Down Expand Up @@ -110,3 +111,13 @@ def kuma_status(base_url):
@pytest.fixture(scope='session')
def is_debug(kuma_status):
return kuma_status['settings']['DEBUG']


@pytest.fixture(scope='session')
def is_maintenance_mode(kuma_status):
return kuma_status['settings']['MAINTENANCE_MODE']


@pytest.fixture(scope='session')
def is_behind_cdn(kuma_status):
return 'x-amz-cf-id' in kuma_status['response']['headers']

0 comments on commit 907c7ec

Please sign in to comment.