@@ -102,7 +102,7 @@ async def test_download(jp_fetch, jp_root_dir, followSymlinks, download_hidden,
102102 assert r .code == 200
103103 assert r .headers ["content-type" ] == "application/octet-stream"
104104 assert r .headers ["cache-control" ] == "no-cache"
105-
105+
106106 if format == "zip" :
107107 with zipfile .ZipFile (r .buffer , mode = mode ) as zf :
108108 assert set (zf .namelist ()) == file_list
@@ -111,6 +111,14 @@ async def test_download(jp_fetch, jp_root_dir, followSymlinks, download_hidden,
111111 assert set (map (lambda m : m .name , tf .getmembers ())) == file_list
112112
113113
114+ @pytest .mark .parametrize (
115+ "file_name" ,
116+ [
117+ ('archive' ),
118+ ('archive.hello' ),
119+ ('archive.tar.gz' ),
120+ ],
121+ )
114122@pytest .mark .parametrize (
115123 "format, mode" ,
116124 [
@@ -125,17 +133,17 @@ async def test_download(jp_fetch, jp_root_dir, followSymlinks, download_hidden,
125133 ("tar.xz" , "w|xz" ),
126134 ],
127135)
128- async def test_extract (jp_fetch , jp_root_dir , format , mode ):
136+ async def test_extract (jp_fetch , jp_root_dir , file_name , format , mode ):
129137 # Create a dummy directory.
130- archive_dir_path = jp_root_dir / "extract-archive-dir"
138+ archive_dir_path = jp_root_dir / file_name
131139 archive_dir_path .mkdir (parents = True )
132140
133141 (archive_dir_path / "extract-test1.txt" ).write_text ("hello1" )
134142 (archive_dir_path / "extract-test2.txt" ).write_text ("hello2" )
135143 (archive_dir_path / "extract-test3.md" ).write_text ("hello3" )
136144
137145 # Make an archive
138- archive_dir_path = jp_root_dir / "extract-archive-dir"
146+ archive_dir_path = jp_root_dir / file_name
139147 archive_path = archive_dir_path .with_suffix ("." + format )
140148 if format == "zip" :
141149 with zipfile .ZipFile (archive_path , mode = mode ) as writer :
0 commit comments