mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
3cb9bab9f1
When we run the HGE server inside the test harness, it needs to run with an admin secret for some tests to make sense. This tags each test that requires an admin secret with `pytest.mark.admin_secret`, which then generates a UUID and injects that into both the server and the test case (if required). It also simplifies the way the test harness picks up an existing admin secret, allowing it to use the environment variable instead of requiring it via a parameter. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6120 GitOrigin-RevId: 55c5b9e8c99bdad9c8304098444ddb9516749a2c
23 lines
577 B
Python
23 lines
577 B
Python
import pytest
|
|
|
|
def v1qCompat(hge_ctx, q):
|
|
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()
|
|
|
|
@pytest.mark.admin_secret
|
|
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
|