diff --git a/test/test_scripts_fetch_content.py b/test/test_scripts_fetch_content.py index 45bb5e2d..8762e173 100644 --- a/test/test_scripts_fetch_content.py +++ b/test/test_scripts_fetch_content.py @@ -1,4 +1,5 @@ import os +import pathlib import urllib.request from importlib.machinery import SourceFileLoader from importlib.util import module_from_spec, spec_from_loader @@ -6,7 +7,6 @@ import pytest -import pathlib import taskgraph @@ -96,6 +96,7 @@ def getheader(field): if not raises: raise + @pytest.mark.parametrize( "expected,orig,dest", [ @@ -105,7 +106,6 @@ def getheader(field): (True, pathlib.Path("archive.tgz"), pathlib.Path("archive.tar.zst")), (True, pathlib.Path("archive.zip"), pathlib.Path("archive.tar.zst")), (True, pathlib.Path("archive.tar.xz"), pathlib.Path("archive.tar.zst")), - # Path is exactly the same (False, pathlib.Path("archive"), pathlib.Path("archive")), (False, pathlib.Path("archive.tar"), pathlib.Path("archive.tar")), @@ -113,11 +113,16 @@ def getheader(field): (False, pathlib.Path("archive.zip"), pathlib.Path("archive.zip")), (False, pathlib.Path("file.txt"), pathlib.Path("file.txt")), (False, pathlib.Path("archive.tar.zst"), pathlib.Path("archive.tar.zst")), - # Real edge cases (False, pathlib.Path("python-3.8.10-amd64.exe"), pathlib.Path("python.exe")), - (False, pathlib.Path("9ee26e91-9b52-44ba-8d30-c0230dd587b2.bin"), pathlib.Path("model.esen.intgemm.alphas.bin")), + ( + False, + pathlib.Path("9ee26e91-9b52-44ba-8d30-c0230dd587b2.bin"), + pathlib.Path("model.esen.intgemm.alphas.bin"), + ), ], ) def test_should_try_to_repack_archive(fetch_content_mod, orig, dest, expected): - assert fetch_content_mod.should_try_to_repack_archive(orig, dest) == expected, f"Failed for orig: {orig}, dest: {dest}, expected {expected} but received {not expected}" + assert ( + fetch_content_mod.should_try_to_repack_archive(orig, dest) == expected + ), f"Failed for orig: {orig}, dest: {dest}, expected {expected} but received {not expected}"