File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 860
860
"affiliation" : " MIT, HMS" ,
861
861
"name" : " Ghosh, Satrajit" ,
862
862
"orcid" : " 0000-0002-5312-6729"
863
+ },
864
+ {
865
+ "name" : " Hui Qian, Tan"
863
866
}
864
867
],
865
868
"keywords" : [
Original file line number Diff line number Diff line change 4
4
import re
5
5
from copy import deepcopy
6
6
import itertools as it
7
+ import glob
7
8
from glob import iglob
8
9
9
10
from ..utils .filemanip import split_filename
@@ -494,4 +495,6 @@ def _list_outputs(self):
494
495
495
496
# https://stackoverflow.com/a/4829130
496
497
def search_files (prefix , outtypes ):
497
- return it .chain .from_iterable (iglob (prefix + outtype ) for outtype in outtypes )
498
+ return it .chain .from_iterable (
499
+ iglob (glob .escape (prefix + outtype )) for outtype in outtypes
500
+ )
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+
4
+ from nipype .interfaces import dcm2nii
5
+
6
+
7
+ @pytest .mark .parametrize (
8
+ "fname, extension" ,
9
+ [
10
+ ("output_1" , ".txt" ),
11
+ ("output_w_[]_meta_1" , ".json" ),
12
+ ("output_w_**^$?_meta_2" , ".txt" ),
13
+ ],
14
+ )
15
+ def test_search_files (tmp_path , fname , extension ):
16
+ tmp_fname = fname + extension
17
+ test_file = tmp_path / tmp_fname
18
+ test_file .touch ()
19
+ actual_files_list = dcm2nii .search_files (str (tmp_path / fname ), [extension ])
20
+ for f in actual_files_list :
21
+ assert str (test_file ) == f
You can’t perform that action at this time.
0 commit comments