From 98eef8d08e6fd3dded59b9f71736abd4841db4ea Mon Sep 17 00:00:00 2001 From: dettlaff Date: Thu, 12 Oct 2023 02:40:47 +0400 Subject: [PATCH] fix: tests, jobs.error return --- selfprivacy_api/jobs/nix_collect_garbage.py | 4 ++-- tests/test_graphql/test_nix_collect_garbage.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfprivacy_api/jobs/nix_collect_garbage.py b/selfprivacy_api/jobs/nix_collect_garbage.py index a0d5d9a..a623f9f 100644 --- a/selfprivacy_api/jobs/nix_collect_garbage.py +++ b/selfprivacy_api/jobs/nix_collect_garbage.py @@ -43,7 +43,7 @@ def parse_line(line): if match is None: return ( - JobStatus.FINISHED, + JobStatus.ERROR, 100, COMPLETED_WITH_ERROR, RESULT_WAS_NOT_FOUND_ERROR, @@ -98,7 +98,7 @@ def get_dead_packages(output): @huey.task() -def calculate_and_clear_dead_packages(job: Jobs): +def calculate_and_clear_dead_packages(job: Job): Jobs.update( job=Job, status=JobStatus.RUNNING, diff --git a/tests/test_graphql/test_nix_collect_garbage.py b/tests/test_graphql/test_nix_collect_garbage.py index a23f7ea..db62ef1 100644 --- a/tests/test_graphql/test_nix_collect_garbage.py +++ b/tests/test_graphql/test_nix_collect_garbage.py @@ -86,7 +86,7 @@ def test_parse_line(job_reset): def test_parse_line_with_blank_line(job_reset): txt = "" output = ( - JobStatus.FINISHED, + JobStatus.ERROR, 100, COMPLETED_WITH_ERROR, RESULT_WAS_NOT_FOUND_ERROR,