mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +03:00
30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
#!/usrbin/env python3
|
|
|
|
import pytest
|
|
from validate import check_query_f
|
|
from super_classes import DefaultTestSelectQueries
|
|
|
|
@pytest.mark.skipif(not pytest.config.getoption("--test-allowlist-queries"),
|
|
reason="flag --test-allowlist-queries is not set. Cannot runt tests for allowlist queries")
|
|
@pytest.mark.parametrize("transport", ['http','websocket'])
|
|
class TestAllowlistQueries(DefaultTestSelectQueries):
|
|
|
|
def test_query_user(self, hge_ctx, transport):
|
|
check_query_f(hge_ctx, self.dir() + '/query_user.yaml', transport)
|
|
|
|
def test_query_user_by_pk(self, hge_ctx, transport):
|
|
check_query_f(hge_ctx, self.dir() + '/query_user_by_pk.yaml', transport)
|
|
|
|
def test_query_user_with_typename(self, hge_ctx, transport):
|
|
check_query_f(hge_ctx, self.dir() + '/query_user_with_typename.yaml', transport)
|
|
|
|
def test_query_non_allowlist(self, hge_ctx, transport):
|
|
check_query_f(hge_ctx, self.dir() + '/query_non_allowlist.yaml', transport)
|
|
|
|
def test_query_as_admin(self, hge_ctx, transport):
|
|
check_query_f(hge_ctx, self.dir() + '/query_as_admin.yaml', transport)
|
|
|
|
@classmethod
|
|
def dir(cls):
|
|
return 'queries/graphql_query/allowlist'
|