2022-06-29 17:39:46 +00:00
|
|
|
# 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"
|
|
|
|
|
2022-07-07 13:53:19 +00:00
|
|
|
|
2022-06-29 17:39:46 +00:00
|
|
|
def test_graphql_get_api_version(authorized_client):
|
2022-08-25 17:03:56 +00:00
|
|
|
response = authorized_client.post(
|
2022-06-29 17:39:46 +00:00
|
|
|
"/graphql",
|
2022-07-07 13:53:19 +00:00
|
|
|
json={"query": generate_api_query([API_VERSION_QUERY])},
|
2022-06-29 17:39:46 +00:00
|
|
|
)
|
|
|
|
assert response.status_code == 200
|
2022-08-25 17:03:56 +00:00
|
|
|
assert "version" in response.json()["data"]["api"]
|
2022-06-29 17:39:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_graphql_api_version_unauthorized(client):
|
2022-08-25 17:03:56 +00:00
|
|
|
response = client.post(
|
2022-06-29 17:39:46 +00:00
|
|
|
"/graphql",
|
2022-07-07 13:53:19 +00:00
|
|
|
json={"query": generate_api_query([API_VERSION_QUERY])},
|
2022-06-29 17:39:46 +00:00
|
|
|
)
|
|
|
|
assert response.status_code == 200
|
2022-08-25 17:03:56 +00:00
|
|
|
assert "version" in response.json()["data"]["api"]
|