218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | |
def test_sysfind_multiple(self): |
dir = py.test.ensuretemp('sysfind') |
env = py.std.os.environ |
oldpath = env['PATH'] |
try: |
env['PATH'] += ":%s:%s" % (dir.ensure('a'), |
dir.join('b')) |
dir.ensure('b', 'a') |
checker = lambda x: x.dirpath().basename == 'b' |
-> x = py.path.local.sysfind('a', checker=checker) |
assert x.basename == 'a' |
assert x.dirpath().basename == 'b' |
checker = lambda x: None |
assert py.path.local.sysfind('a', checker=checker) is None |
finally: |
env['PATH'] = oldpath | |