From 3be5816f5113c45e9cfcb5d0636a07c1c847813c Mon Sep 17 00:00:00 2001 From: dettlaff Date: Sun, 12 Nov 2023 01:38:31 +0400 Subject: [PATCH] fix: del unused return from parse line --- selfprivacy_api/jobs/nix_collect_garbage.py | 8 ++------ tests/test_graphql/test_nix_collect_garbage.py | 3 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/selfprivacy_api/jobs/nix_collect_garbage.py b/selfprivacy_api/jobs/nix_collect_garbage.py index 12bce80..f6ad9ad 100644 --- a/selfprivacy_api/jobs/nix_collect_garbage.py +++ b/selfprivacy_api/jobs/nix_collect_garbage.py @@ -44,7 +44,6 @@ def parse_line(line: str): if match is None: return ( JobStatus.ERROR, - 100, COMPLETED_WITH_ERROR, RESULT_WAS_NOT_FOUND_ERROR, ) @@ -52,7 +51,6 @@ def parse_line(line: str): else: return ( JobStatus.FINISHED, - 100, CLEAR_COMPLETED, f"{match.group(0)} have been cleared", ) @@ -83,9 +81,8 @@ def process_stream(job: Job, stream: Iterable[bytes], total_dead_packages: int) Jobs.update( job=Job, status=status[0], - progress=status[1], - status_text=status[2], - result=status[3], + status_text=status[1], + result=status[2], ) @@ -114,7 +111,6 @@ def calculate_and_clear_dead_packages(job: Job): Jobs.update( job=Job, status=JobStatus.FINISHED, - progress=100, status_text="Nothing to clear", result="System is clear", ) diff --git a/tests/test_graphql/test_nix_collect_garbage.py b/tests/test_graphql/test_nix_collect_garbage.py index a2422a7..1e3a9f0 100644 --- a/tests/test_graphql/test_nix_collect_garbage.py +++ b/tests/test_graphql/test_nix_collect_garbage.py @@ -3,7 +3,6 @@ # pylint: disable=missing-function-docstring import pytest -import strawberry from selfprivacy_api.jobs import JobStatus, Jobs @@ -70,7 +69,6 @@ def test_parse_line(job_reset): txt = "190 store paths deleted, 425.51 MiB freed" output = ( JobStatus.FINISHED, - 100, CLEAR_COMPLETED, "425.51 MiB have been cleared", ) @@ -81,7 +79,6 @@ def test_parse_line_with_blank_line(job_reset): txt = "" output = ( JobStatus.ERROR, - 100, COMPLETED_WITH_ERROR, RESULT_WAS_NOT_FOUND_ERROR, )