File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -495,4 +495,6 @@ def _list_outputs(self):
495495
496496# https://stackoverflow.com/a/4829130 
497497def  search_files (prefix , outtypes ):
498-     return  it .chain .from_iterable (iglob (glob .escape (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