File tree Expand file tree Collapse file tree 3 files changed +41
-8
lines changed
Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 11<tool id =" CONVERTER_archive_to_directory" name =" Unpack archive to directory" version =" 1.0.0" profile =" 21.09" >
22 <!-- Use compression_utils instead of shell commands (tar/unzip) so we can verify safety of results -->
33 <requirements >
4- <requirement type =" package" version =" 25.0 " >galaxy-util</requirement >
4+ <requirement type =" package" version =" 25.1 " >galaxy-util</requirement >
55 </requirements >
66 <command ><![CDATA[
77 mkdir '$output1.files_path' &&
3131 <test >
3232 <param name =" input1" ftype =" tar" value =" testdir1.tar" />
3333 <param name =" __target_datatype__" value =" directory" />
34- <output name =" output1" ftype =" directory" value =" testdir1.tar.directory" />
34+ <output name =" output1" ftype =" directory" value =" testdir1.tar.directory" >
35+ <extra_files name =" testdir1/file1" >
36+ <assert_contents >
37+ <has_text text =" hello" />
38+ </assert_contents >
39+ </extra_files >
40+ <extra_files name =" testdir1/file2" >
41+ <assert_contents >
42+ <has_text text =" world" />
43+ </assert_contents >
44+ </extra_files >
45+ <extra_files name =" testdir1/dir1/file3" >
46+ <assert_contents >
47+ <has_text text =" subdirfile" />
48+ </assert_contents >
49+ </extra_files >
50+ </output >
51+ </test >
52+ <test >
53+ <param name =" input1" ftype =" tar" value =" testdir1_flat.zip" />
54+ <param name =" __target_datatype__" value =" directory" />
55+ <output name =" output1" ftype =" directory" value =" testdir1.tar.directory" >
56+ <extra_files name =" file1" >
57+ <assert_contents >
58+ <has_text text =" hello" />
59+ </assert_contents >
60+ </extra_files >
61+ <extra_files name =" file2" >
62+ <assert_contents >
63+ <has_text text =" world" />
64+ </assert_contents >
65+ </extra_files >
66+ <extra_files name =" dir1/file3" >
67+ <assert_contents >
68+ <has_text text =" subdirfile" />
69+ </assert_contents >
70+ </extra_files >
71+ </output >
3572 </test >
3673 </tests >
3774 <help >
Original file line number Diff line number Diff line change @@ -253,10 +253,6 @@ def extract(self, path: StrPath) -> str:
253253 members_z = cast (Iterable [str ], self .safemembers ())
254254 self .archive .extractall (extraction_path , members = members_z )
255255 else :
256- if not common_prefix_dir :
257- extraction_path = os .path .join (path , self .file_name )
258- if not os .path .exists (extraction_path ):
259- os .makedirs (extraction_path )
260256 if isinstance (self .archive , tarfile .TarFile ):
261257 members_t = cast (Iterable [tarfile .TarInfo ], self .safemembers ())
262258 self .archive .extractall (extraction_path , members = members_t )
Original file line number Diff line number Diff line change @@ -740,12 +740,12 @@ def test_export_invocation_to_ro_crate_archive(tmp_path):
740740 workflow_invocation = _setup_invocation (app )
741741
742742 crate_zip = tmp_path / "crate.zip"
743+ crate_directory = tmp_path / "crate"
743744 with store .ROCrateArchiveModelExportStore (crate_zip , app = app , export_files = "symlink" ) as export_store :
744745 export_store .export_workflow_invocation (workflow_invocation )
745746 with CompressedFile (crate_zip ) as compressed_file :
746747 assert compressed_file .file_type == "zip"
747- compressed_file .extract (tmp_path )
748- crate_directory = tmp_path / "crate"
748+ compressed_file .extract (crate_directory )
749749 validate_invocation_crate_directory (crate_directory )
750750
751751
You can’t perform that action at this time.
0 commit comments