示例#1
0
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
示例#2
0
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
示例#3
0
    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),)
示例#4
0
    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),)
示例#5
0
def test_which_executable__non_executable():
    assert_is(None, which_executable("lsxxxx"))
示例#6
0
def test_which_executable__executable():
    assert_equal("/bin/ls", which_executable("ls"))