-
- @pytest.fixture(scope='session')
- def setup():
-
- settings = load_settings()
- _token = settings['token']
-
- headers = {
- 'user-agent': 'application/json',
- 'Authorization': 'Bearer ' + str(_token),
- }
-
-
- def test_fetching_datafile_via_cdn(setup):
-
- url = f'https://abc.com/public/{settings["accountId"]}/s/{settings["project_id"]}_production.json'
-
- r = requests.get(url, headers=headers)
- assert r.status_code == 200
- cdn_datafile = r.text
- # TODO to add assertions once 400 error is fixed
-
-
- def test_fetching_datafile_via_rest_api(setup):
-
- url = f'https://www.abc.com/experiment/v1/projects/{settings["project_id"]}/json'
-
- r = requests.get(url, headers=headers)
- assert r.status_code == 200
- rest_datafile = r.json()
-
- # convert dict-string to dict
- cdn_datafile = json.loads(get_datafile())
-
- # comparing dicts of datafiles
- assert rest_datafile == cdn_datafile
-