2022-06-24 18:14:20 +00:00
|
|
|
# pylint: disable=redefined-outer-name
|
|
|
|
# pylint: disable=unused-argument
|
2022-06-29 17:39:46 +00:00
|
|
|
# pylint: disable=missing-function-docstring
|
2022-06-24 18:14:20 +00:00
|
|
|
|
2022-06-29 17:39:46 +00:00
|
|
|
from tests.common import generate_api_query
|
2023-01-09 15:29:43 +00:00
|
|
|
from tests.test_graphql.common import assert_original_devices
|
2022-06-29 17:39:46 +00:00
|
|
|
from tests.test_graphql.test_api_devices import API_DEVICES_QUERY
|
|
|
|
from tests.test_graphql.test_api_recovery import API_RECOVERY_QUERY
|
|
|
|
from tests.test_graphql.test_api_version import API_VERSION_QUERY
|
|
|
|
|
2022-07-07 13:53:19 +00:00
|
|
|
|
2024-01-09 18:58:09 +00:00
|
|
|
def test_graphql_get_entire_api_data(authorized_client):
|
2022-08-25 17:03:56 +00:00
|
|
|
response = authorized_client.post(
|
2022-06-24 18:14:20 +00:00
|
|
|
"/graphql",
|
|
|
|
json={
|
2022-07-07 13:53:19 +00:00
|
|
|
"query": generate_api_query(
|
|
|
|
[API_VERSION_QUERY, API_DEVICES_QUERY, API_RECOVERY_QUERY]
|
|
|
|
)
|
2022-06-24 18:14:20 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
assert response.status_code == 200
|
2022-08-25 17:03:56 +00:00
|
|
|
assert response.json().get("data") is not None
|
|
|
|
assert "version" in response.json()["data"]["api"]
|
2023-01-09 15:29:43 +00:00
|
|
|
|
|
|
|
devices = response.json()["data"]["api"]["devices"]
|
|
|
|
assert devices is not None
|
|
|
|
assert_original_devices(devices)
|
|
|
|
|
2022-08-25 17:03:56 +00:00
|
|
|
assert response.json()["data"]["api"]["recoveryKey"] is not None
|
|
|
|
assert response.json()["data"]["api"]["recoveryKey"]["exists"] is False
|
|
|
|
assert response.json()["data"]["api"]["recoveryKey"]["valid"] is False
|
|
|
|
assert response.json()["data"]["api"]["recoveryKey"]["creationDate"] is None
|
|
|
|
assert response.json()["data"]["api"]["recoveryKey"]["expirationDate"] is None
|
|
|
|
assert response.json()["data"]["api"]["recoveryKey"]["usesLeft"] is None
|