mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-31 05:06:41 +00:00
tests: fix
This commit is contained in:
parent
be8d249a04
commit
a316f8b910
|
@ -6,7 +6,7 @@ from selfprivacy_api.graphql import IsAuthenticated
|
||||||
from selfprivacy_api.graphql.mutations.mutation_interface import (
|
from selfprivacy_api.graphql.mutations.mutation_interface import (
|
||||||
GenericMutationReturn,
|
GenericMutationReturn,
|
||||||
MutationReturnInterface,
|
MutationReturnInterface,
|
||||||
GenericJobButationReturn,
|
GenericJobMutationReturn,
|
||||||
)
|
)
|
||||||
|
|
||||||
import selfprivacy_api.actions.system as system_actions
|
import selfprivacy_api.actions.system as system_actions
|
||||||
|
@ -131,10 +131,10 @@ class SystemMutations:
|
||||||
)
|
)
|
||||||
|
|
||||||
@strawberry.mutation(permission_classes=[IsAuthenticated])
|
@strawberry.mutation(permission_classes=[IsAuthenticated])
|
||||||
def nix_collect_garbage(self) -> GenericJobButationReturn:
|
def nix_collect_garbage(self) -> GenericJobMutationReturn:
|
||||||
job = start_nix_collect_garbage()
|
job = start_nix_collect_garbage()
|
||||||
|
|
||||||
return GenericJobButationReturn(
|
return GenericJobMutationReturn(
|
||||||
success=True,
|
success=True,
|
||||||
code=200,
|
code=200,
|
||||||
message="Cleaning started..,",
|
message="Cleaning started..,",
|
||||||
|
|
|
@ -113,11 +113,13 @@ def test_get_dead_packages_zero(job_reset):
|
||||||
|
|
||||||
|
|
||||||
RUN_NIX_COLLECT_GARBAGE_QUERY = """
|
RUN_NIX_COLLECT_GARBAGE_QUERY = """
|
||||||
mutation system {
|
mutation CollectGarbage {
|
||||||
nixCollectGarbage {
|
system {
|
||||||
success
|
nixCollectGarbage {
|
||||||
message
|
success
|
||||||
code
|
message
|
||||||
|
code
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
@ -133,7 +135,7 @@ def test_graphql_nix_collect_garbage(authorized_client):
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.json().get("data") is not None
|
assert response.json().get("data") is not None
|
||||||
assert response.json()["data"]["nixCollectGarbage"]["success"] is True
|
assert response.json()["data"]["system"]["nixCollectGarbage"]["success"] is True
|
||||||
assert response.json()["data"]["nixCollectGarbage"]["message"] is not None
|
assert response.json()["data"]["system"]["nixCollectGarbage"]["message"] is not None
|
||||||
assert response.json()["data"]["nixCollectGarbage"]["code"] == 200
|
assert response.json()["data"]["system"]["nixCollectGarbage"]["success"] == True
|
||||||
assert response.json()["data"]["nixCollectGarbage"]["success"] == True
|
assert response.json()["data"]["system"]["nixCollectGarbage"]["code"] == 200
|
||||||
|
|
Loading…
Reference in a new issue