コード例 #1
0
ファイル: fileutils_test.py プロジェクト: health1987/paleomix
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
ファイル: fileutils_test.py プロジェクト: health1987/paleomix
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
ファイル: versions.py プロジェクト: health1987/paleomix
    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
ファイル: fileutils_test.py プロジェクト: health1987/paleomix
def test_which_executable__non_executable():
    assert_is(None, which_executable("lsxxxx"))
コード例 #6
0
ファイル: fileutils_test.py プロジェクト: health1987/paleomix
def test_which_executable__executable():
    assert_equal("/bin/ls", which_executable("ls"))