From 34a759b8044123bbf5d0aa66dedd3b563fe3a014 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 14 Nov 2024 16:27:26 +0100 Subject: backend/lint: Implement flake8-simplify suggestions --- tests/scanner/test_scanner.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'tests/scanner') diff --git a/tests/scanner/test_scanner.py b/tests/scanner/test_scanner.py index a70c4d8..6fc6650 100644 --- a/tests/scanner/test_scanner.py +++ b/tests/scanner/test_scanner.py @@ -104,18 +104,17 @@ async def test_scanner_dedups_archive_contents(archive, scanner, capsys): archive = await DB.add(archive) dedup_path = archive.path + ".dedup" - with ZipFile(archive.path, "r") as zin: - with ZipFile(dedup_path, "w") as zout: - for info in zin.infolist(): - base, ext = os.path.splitext(info.filename) - - if base == "03": - continue - - if ext == ".png": - zout.writestr(f"0{base}.png", zin.read(info)) - else: - zout.writestr(info.filename, zin.read(info)) + with ZipFile(archive.path, "r") as zin, ZipFile(dedup_path, "w") as zout: + for info in zin.infolist(): + base, ext = os.path.splitext(info.filename) + + if base == "03": + continue + + if ext == ".png": + zout.writestr(f"0{base}.png", zin.read(info)) + else: + zout.writestr(info.filename, zin.read(info)) await scanner.scan() added_archive = await DB.get(Archive, 2, full=True) -- cgit v1.2.3-2-gb3c3