tests: fix

This commit is contained in:
dettlaff 2023-08-07 16:56:35 +04:00
parent be8d249a04
commit a316f8b910
3 changed files with 14 additions and 12 deletions

BIN
dump.rdb

Binary file not shown.

View File

@ -6,7 +6,7 @@ from selfprivacy_api.graphql import IsAuthenticated
from selfprivacy_api.graphql.mutations.mutation_interface import (
GenericMutationReturn,
MutationReturnInterface,
GenericJobButationReturn,
GenericJobMutationReturn,
)
import selfprivacy_api.actions.system as system_actions
@ -131,10 +131,10 @@ class SystemMutations:
)
@strawberry.mutation(permission_classes=[IsAuthenticated])
def nix_collect_garbage(self) -> GenericJobButationReturn:
def nix_collect_garbage(self) -> GenericJobMutationReturn:
job = start_nix_collect_garbage()
return GenericJobButationReturn(
return GenericJobMutationReturn(
success=True,
code=200,
message="Cleaning started..,",

View File

@ -113,11 +113,13 @@ def test_get_dead_packages_zero(job_reset):
RUN_NIX_COLLECT_GARBAGE_QUERY = """
mutation system {
nixCollectGarbage {
success
message
code
mutation CollectGarbage {
system {
nixCollectGarbage {
success
message
code
}
}
}
"""
@ -133,7 +135,7 @@ def test_graphql_nix_collect_garbage(authorized_client):
assert response.status_code == 200
assert response.json().get("data") is not None
assert response.json()["data"]["nixCollectGarbage"]["success"] is True
assert response.json()["data"]["nixCollectGarbage"]["message"] is not None
assert response.json()["data"]["nixCollectGarbage"]["code"] == 200
assert response.json()["data"]["nixCollectGarbage"]["success"] == True
assert response.json()["data"]["system"]["nixCollectGarbage"]["success"] is True
assert response.json()["data"]["system"]["nixCollectGarbage"]["message"] is not None
assert response.json()["data"]["system"]["nixCollectGarbage"]["success"] == True
assert response.json()["data"]["system"]["nixCollectGarbage"]["code"] == 200