summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/api/test_sort.py2
-rw-r--r--tests/scanner/test_scanner.py23
2 files changed, 12 insertions, 13 deletions
diff --git a/tests/api/test_sort.py b/tests/api/test_sort.py
index 9cafe82..404e3d6 100644
--- a/tests/api/test_sort.py
+++ b/tests/api/test_sort.py
@@ -135,4 +135,4 @@ async def test_query_namespace_sort_sort_name(query_namespace_sort):
response = Response(await query_namespace_sort({"on": "SORT_NAME"}))
response.assert_is("NamespaceFilterResult")
- assert ["two", "one"] == [edge["name"] for edge in response.edges]
+ assert [edge["name"] for edge in response.edges] == ["two", "one"]
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)