def test_returns_more_than_one_match_when_available(self): self.path_append('bin') ls = self.create_sh('ls') eq_(list(which('ls')), [ls]) bin_ls = self.create_sh('bin/ls') eq_(list(which('ls')), [ls, bin_ls])
def test_returns_empty_list_when_file_is_not_found(self): eq_(list(which('non-existent')), [])
def test_does_not_pick_up_files_that_are_not_executable(self): ls = self.create_sh('ls', mode=0o600) eq_(list(which('ls')), []) os.chmod(ls, 0o755) eq_(list(which('ls')), [ls])