graphql-engine/server/tests-py/test_compat.py
nizar-m f83a8e591f rename access-key to admin-secret (close #1347) (#1540)
Rename the admin secret key header used to access GraphQL engine from X-Hasura-Access-Key to X-Hasura-Admin-Secret.

Server CLI and console all support the older flag but marks it as deprecated.
2019-02-14 15:07:47 +05:30

25 lines
697 B
Python

import pytest
if not pytest.config.getoption("--hge-key"):
pytest.skip("--hge-key flag is missing, skipping tests", allow_module_level=True)
def v1qCompat(hge_ctx, q, headers = {}):
h = {'X-Hasura-Access-Key': hge_ctx.hge_key}
resp = hge_ctx.http.post(
hge_ctx.hge_url + "/v1/query",
json=q,
headers=h
)
return resp.status_code, resp.json()
class TestGraphQLCompatAccessKey():
export_metadata = {
"type" : "export_metadata",
"args" : {}
}
def test_compact_access_key_export_metadata(self, hge_ctx):
code, resp = v1qCompat(hge_ctx, self.export_metadata)
assert code == 200, resp