From 045ad30ec3742727ed4019db2986f5ad0c01dadb Mon Sep 17 00:00:00 2001 From: dettlaff Date: Tue, 30 Jan 2024 18:04:43 +0400 Subject: [PATCH] fix: add mock for nix collect garbage --- tests/test_graphql/test_nix_collect_garbage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_graphql/test_nix_collect_garbage.py b/tests/test_graphql/test_nix_collect_garbage.py index c4b44d7..547eb70 100644 --- a/tests/test_graphql/test_nix_collect_garbage.py +++ b/tests/test_graphql/test_nix_collect_garbage.py @@ -52,6 +52,11 @@ note: currently hard linking saves 0.00 MiB log_event = [] +@pytest.fixture +def mock_delete_old_gens_and_print_dead(mocker): + mock = mocker.patch("selfprivacy_api.jobs.nix_collect_garbage.delete_old_gens_and_print_dead", autospec=True, return_value=None) + return mock + # --- @@ -119,7 +124,7 @@ mutation CollectGarbage { """ -def test_graphql_nix_collect_garbage(authorized_client): +def test_graphql_nix_collect_garbage(authorized_client, mock_delete_old_gens_and_print_dead): response = authorized_client.post( "/graphql", json={