mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-18 00:19:15 +00:00
7935de0fe1
Co-authored-by: inexcode <inex.code@selfprivacy.org> Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/13
26 lines
739 B
Python
26 lines
739 B
Python
# pylint: disable=redefined-outer-name
|
|
# pylint: disable=unused-argument
|
|
# pylint: disable=missing-function-docstring
|
|
|
|
from tests.common import generate_api_query
|
|
|
|
API_VERSION_QUERY = "version"
|
|
|
|
|
|
def test_graphql_get_api_version(authorized_client):
|
|
response = authorized_client.post(
|
|
"/graphql",
|
|
json={"query": generate_api_query([API_VERSION_QUERY])},
|
|
)
|
|
assert response.status_code == 200
|
|
assert "version" in response.json()["data"]["api"]
|
|
|
|
|
|
def test_graphql_api_version_unauthorized(client):
|
|
response = client.post(
|
|
"/graphql",
|
|
json={"query": generate_api_query([API_VERSION_QUERY])},
|
|
)
|
|
assert response.status_code == 200
|
|
assert "version" in response.json()["data"]["api"]
|