diff --git a/dump.rdb b/dump.rdb index 5198f51..ddf1da5 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/selfprivacy_api/graphql/mutations/system_mutations.py b/selfprivacy_api/graphql/mutations/system_mutations.py index c483168..aea3bd5 100644 --- a/selfprivacy_api/graphql/mutations/system_mutations.py +++ b/selfprivacy_api/graphql/mutations/system_mutations.py @@ -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..,", diff --git a/tests/test_graphql/test_nix_collect_garbage.py b/tests/test_graphql/test_nix_collect_garbage.py index 900014a..703dbed 100644 --- a/tests/test_graphql/test_nix_collect_garbage.py +++ b/tests/test_graphql/test_nix_collect_garbage.py @@ -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