mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-09-29 11:37:52 +00:00
fix: del unused return from parse line
This commit is contained in:
parent
d31ad487eb
commit
3be5816f51
|
@ -44,7 +44,6 @@ def parse_line(line: str):
|
||||||
if match is None:
|
if match is None:
|
||||||
return (
|
return (
|
||||||
JobStatus.ERROR,
|
JobStatus.ERROR,
|
||||||
100,
|
|
||||||
COMPLETED_WITH_ERROR,
|
COMPLETED_WITH_ERROR,
|
||||||
RESULT_WAS_NOT_FOUND_ERROR,
|
RESULT_WAS_NOT_FOUND_ERROR,
|
||||||
)
|
)
|
||||||
|
@ -52,7 +51,6 @@ def parse_line(line: str):
|
||||||
else:
|
else:
|
||||||
return (
|
return (
|
||||||
JobStatus.FINISHED,
|
JobStatus.FINISHED,
|
||||||
100,
|
|
||||||
CLEAR_COMPLETED,
|
CLEAR_COMPLETED,
|
||||||
f"{match.group(0)} have been cleared",
|
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(
|
Jobs.update(
|
||||||
job=Job,
|
job=Job,
|
||||||
status=status[0],
|
status=status[0],
|
||||||
progress=status[1],
|
status_text=status[1],
|
||||||
status_text=status[2],
|
result=status[2],
|
||||||
result=status[3],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,7 +111,6 @@ def calculate_and_clear_dead_packages(job: Job):
|
||||||
Jobs.update(
|
Jobs.update(
|
||||||
job=Job,
|
job=Job,
|
||||||
status=JobStatus.FINISHED,
|
status=JobStatus.FINISHED,
|
||||||
progress=100,
|
|
||||||
status_text="Nothing to clear",
|
status_text="Nothing to clear",
|
||||||
result="System is clear",
|
result="System is clear",
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
# pylint: disable=missing-function-docstring
|
# pylint: disable=missing-function-docstring
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import strawberry
|
|
||||||
|
|
||||||
from selfprivacy_api.jobs import JobStatus, Jobs
|
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"
|
txt = "190 store paths deleted, 425.51 MiB freed"
|
||||||
output = (
|
output = (
|
||||||
JobStatus.FINISHED,
|
JobStatus.FINISHED,
|
||||||
100,
|
|
||||||
CLEAR_COMPLETED,
|
CLEAR_COMPLETED,
|
||||||
"425.51 MiB have been cleared",
|
"425.51 MiB have been cleared",
|
||||||
)
|
)
|
||||||
|
@ -81,7 +79,6 @@ def test_parse_line_with_blank_line(job_reset):
|
||||||
txt = ""
|
txt = ""
|
||||||
output = (
|
output = (
|
||||||
JobStatus.ERROR,
|
JobStatus.ERROR,
|
||||||
100,
|
|
||||||
COMPLETED_WITH_ERROR,
|
COMPLETED_WITH_ERROR,
|
||||||
RESULT_WAS_NOT_FOUND_ERROR,
|
RESULT_WAS_NOT_FOUND_ERROR,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue