def test_which_executable__executable__by_path_order_2(): path = os.environ.pop('PATH') try: os.environ['PATH'] = "tests/function:tests/unit" assert_equal("tests/function/run", which_executable("run")) finally: os.environ['PATH'] = path
def test_which_executable__executable__but_empty_path(): path = os.environ.pop('PATH') try: os.environ['PATH'] = "" assert_is(None, which_executable("ls")) finally: os.environ['PATH'] = path
def _describe_call(self): """Yields string describing the current system call, if any. """ if self.executable: exec_path = which_executable(self.executable) yield " Executable: %s" % (exec_path,) if not isinstance(self._call[0], collections.Callable): yield " Call: %s" % (" ".join(self._call),)
def _describe_call(self): """Yields string describing the current system call, if any. """ if self.executable: exec_path = which_executable(self.executable) or self.executable yield " Executable: %s" % (exec_path,) if not isinstance(self._call[0], collections.Callable): yield " Call: %s" % (" ".join(self._call),)
def test_which_executable__non_executable(): assert_is(None, which_executable("lsxxxx"))
def test_which_executable__executable(): assert_equal("/bin/ls", which_executable("ls"))