@@ -2158,11 +2158,11 @@ def test_search_file(self):
21582158 self .assertEqual (var_defs , [])
21592159 self .assertEqual (len (hits ), 5 )
21602160 self .assertTrue (all (os .path .exists (p ) for p in hits ))
2161- self .assertTrue (hits [0 ].endswith ('/hwloc-1.11.8 -GCC-4.6.4 .eb' ))
2162- self .assertTrue (hits [1 ].endswith ('/hwloc-1.11.8-GCC-6.4.0-2.28 .eb' ))
2163- self .assertTrue (hits [2 ].endswith ('/hwloc-1.11.8-GCC-7.3.0-2.30 .eb' ))
2164- self .assertTrue (hits [3 ].endswith ('/hwloc-1.6.2 -GCC-4.9.3 -2.26 .eb' ))
2165- self .assertTrue (hits [4 ].endswith ('/hwloc-1.8-gcccuda-2018a .eb' ))
2161+ self .assertTrue (hits [0 ].endswith ('/hwloc-1.6.2 -GCC-4.9.3-2.26 .eb' ))
2162+ self .assertTrue (hits [1 ].endswith ('/hwloc-1.8-gcccuda-2018a .eb' ))
2163+ self .assertTrue (hits [2 ].endswith ('/hwloc-1.11.8-GCC-4.6.4 .eb' ))
2164+ self .assertTrue (hits [3 ].endswith ('/hwloc-1.11.8 -GCC-6.4.0 -2.28 .eb' ))
2165+ self .assertTrue (hits [4 ].endswith ('/hwloc-1.11.8-GCC-7.3.0-2.30 .eb' ))
21662166
21672167 # also test case-sensitive searching
21682168 var_defs , hits_bis = ft .search_file ([test_ecs ], 'HWLOC' , silent = True , case_sensitive = True )
@@ -2176,9 +2176,12 @@ def test_search_file(self):
21762176 # check filename-only mode
21772177 var_defs , hits = ft .search_file ([test_ecs ], 'HWLOC' , silent = True , filename_only = True )
21782178 self .assertEqual (var_defs , [])
2179- self .assertEqual (hits , ['hwloc-1.11.8-GCC-4.6.4.eb' , 'hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2180- 'hwloc-1.11.8-GCC-7.3.0-2.30.eb' , 'hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2181- 'hwloc-1.8-gcccuda-2018a.eb' ])
2179+ self .assertEqual (hits , ['hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2180+ 'hwloc-1.8-gcccuda-2018a.eb' ,
2181+ 'hwloc-1.11.8-GCC-4.6.4.eb' ,
2182+ 'hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2183+ 'hwloc-1.11.8-GCC-7.3.0-2.30.eb' ,
2184+ ])
21822185
21832186 # check specifying of ignored dirs
21842187 var_defs , hits = ft .search_file ([test_ecs ], 'HWLOC' , silent = True , ignore_dirs = ['hwloc' ])
@@ -2187,28 +2190,34 @@ def test_search_file(self):
21872190 # check short mode
21882191 var_defs , hits = ft .search_file ([test_ecs ], 'HWLOC' , silent = True , short = True )
21892192 self .assertEqual (var_defs , [('CFGS1' , os .path .join (test_ecs , 'h' , 'hwloc' ))])
2190- self .assertEqual (hits , ['$CFGS1/hwloc-1.11.8-GCC-4.6.4.eb' , '$CFGS1/hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2191- '$CFGS1/hwloc-1.11.8-GCC-7.3.0-2.30.eb' , '$CFGS1/hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2192- '$CFGS1/hwloc-1.8-gcccuda-2018a.eb' ])
2193+ self .assertEqual (hits , ['$CFGS1/hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2194+ '$CFGS1/hwloc-1.8-gcccuda-2018a.eb' ,
2195+ '$CFGS1/hwloc-1.11.8-GCC-4.6.4.eb' ,
2196+ '$CFGS1/hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2197+ '$CFGS1/hwloc-1.11.8-GCC-7.3.0-2.30.eb'
2198+ ])
21932199
21942200 # check terse mode (implies 'silent', overrides 'short')
21952201 var_defs , hits = ft .search_file ([test_ecs ], 'HWLOC' , terse = True , short = True )
21962202 self .assertEqual (var_defs , [])
21972203 expected = [
2204+ os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.6.2-GCC-4.9.3-2.26.eb' ),
2205+ os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.8-gcccuda-2018a.eb' ),
21982206 os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.11.8-GCC-4.6.4.eb' ),
21992207 os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.11.8-GCC-6.4.0-2.28.eb' ),
22002208 os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.11.8-GCC-7.3.0-2.30.eb' ),
2201- os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.6.2-GCC-4.9.3-2.26.eb' ),
2202- os .path .join (test_ecs , 'h' , 'hwloc' , 'hwloc-1.8-gcccuda-2018a.eb' ),
22032209 ]
22042210 self .assertEqual (hits , expected )
22052211
22062212 # check combo of terse and filename-only
22072213 var_defs , hits = ft .search_file ([test_ecs ], 'HWLOC' , terse = True , filename_only = True )
22082214 self .assertEqual (var_defs , [])
2209- self .assertEqual (hits , ['hwloc-1.11.8-GCC-4.6.4.eb' , 'hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2210- 'hwloc-1.11.8-GCC-7.3.0-2.30.eb' , 'hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2211- 'hwloc-1.8-gcccuda-2018a.eb' ])
2215+ self .assertEqual (hits , ['hwloc-1.6.2-GCC-4.9.3-2.26.eb' ,
2216+ 'hwloc-1.8-gcccuda-2018a.eb' ,
2217+ 'hwloc-1.11.8-GCC-4.6.4.eb' ,
2218+ 'hwloc-1.11.8-GCC-6.4.0-2.28.eb' ,
2219+ 'hwloc-1.11.8-GCC-7.3.0-2.30.eb' ,
2220+ ])
22122221
22132222 # patterns that include special characters + (or ++) shouldn't cause trouble
22142223 # cfr. https://github.com/easybuilders/easybuild-framework/issues/2966
0 commit comments