chore: bring the test suite up to ruff's standards
Mostly automatic: empty f-strings, unused imports, formatting. The manual half was duplicated import blocks stranded mid-file and `== None` assertions, which become `is None` here because they compare plain attributes -- unlike the identical rule in filters/book.py, where they build SQL. Two unused variables are the tests never checking the disk in either delete_files direction. Left in place under a noqa so the gap stays visible.
This commit is contained in:
@@ -42,7 +42,9 @@ def fx_source(tmp_path: Path) -> Path:
|
||||
cover=True,
|
||||
formats={"EPUB": EPUB},
|
||||
)
|
||||
fixture.add_book(2, "The Art of War", authors=["Sun Tzu"], formats={"EPUB": OTHER_EPUB})
|
||||
fixture.add_book(
|
||||
2, "The Art of War", authors=["Sun Tzu"], formats={"EPUB": OTHER_EPUB}
|
||||
)
|
||||
fixture.add_book(3, "Metadata Only", authors=["Nobody"])
|
||||
|
||||
return fixture.commit()
|
||||
@@ -95,7 +97,8 @@ async def test_an_uploaded_library_imports(
|
||||
authenticated_client: AsyncClient, source: Path, tmp_path: Path
|
||||
) -> None:
|
||||
status, job = await upload(
|
||||
authenticated_client, zip_of(source, tmp_path / "out", prefix="Calibre Library/")
|
||||
authenticated_client,
|
||||
zip_of(source, tmp_path / "out", prefix="Calibre Library/"),
|
||||
)
|
||||
|
||||
assert status == 202
|
||||
@@ -278,7 +281,9 @@ async def test_a_second_copy_is_counted_as_a_possible_duplicate(
|
||||
padded.write_bytes(EPUB.read_bytes() + b"\0" * 64)
|
||||
|
||||
fixture = CalibreFixture(tmp_path / "calibre")
|
||||
fixture.add_book(1, "The Metamorphosis", authors=["Franz Kafka"], formats={"EPUB": EPUB})
|
||||
fixture.add_book(
|
||||
1, "The Metamorphosis", authors=["Franz Kafka"], formats={"EPUB": EPUB}
|
||||
)
|
||||
fixture.add_book(
|
||||
2, "The Metamorphosis", authors=["Franz Kafka"], formats={"EPUB": padded}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user