Exemplo n.º 1
0
 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])
Exemplo n.º 2
0
 def test_returns_empty_list_when_file_is_not_found(self):
     eq_(list(which('non-existent')), [])
Exemplo n.º 3
0
 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])