コード例 #1
0
    def test_install_python_minimal(self):
        fLOG(__file__, self._testMethodName, OutputPrint=True)
        vers = "%d%d" % sys.version_info[:2]
        temp = get_temp_folder(__file__,
                               "temp_python%s_minimal" % vers,
                               clean=True)

        if sys.platform.startswith("win"):
            fLOG("BEGIN")
            clog = CustomLog(temp)
            install_python(install=True,
                           temp_folder=temp,
                           fLOG=clog,
                           modules="minimal",
                           custom=True,
                           latest=True,
                           download_folder=temp + "_download")
            fLOG("END")
            pyt = os.path.join(temp, "python.exe")
            pip = os.path.join(temp, "Scripts", "pip.exe")
            if not os.path.exists(pyt):
                raise FileNotFoundError(pyt)
            if not os.path.exists(pip):
                raise FileNotFoundError(pip)
            post = os.path.join(temp, "Scripts", "pywin32_postinstall.py")
            with open(post, "r") as f:
                content = f.read()
            if "os.path.exists(dest)" not in content:
                raise Exception(
                    "'os.path.exists(dest)' not found in '{0}'".format(post))
コード例 #2
0
    def test_install_python(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        temp = os.path.join(fold, "temp_python")
        if not os.path.exists(temp):
            os.mkdir(temp)
        for _ in os.listdir(temp):
            if os.path.isfile(os.path.join(temp, _)):
                os.remove(os.path.join(temp, _))

        if sys.platform.startswith("win"):
            install_python(install=True, temp_folder=temp, fLOG=fLOG)
コード例 #3
0
    def test_install_python(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")
        fold = os.path.abspath(os.path.split(__file__)[0])
        vers = "%d%d" % sys.version_info[:2]
        temp = os.path.join(fold, "temp_python%s" % vers)
        temp = get_temp_folder(__file__, "temp_python_base%s" % vers)

        if sys.platform.startswith("win"):
            clog = CustomLog(temp)
            install_python(install=True,
                           temp_folder=temp,
                           fLOG=clog,
                           download_folder=temp + "_download")
            pyt = os.path.join(temp, "python.exe")
            pip = os.path.join(temp, "Scripts", "pip.exe")
            if not os.path.exists(pyt):
                raise FileNotFoundError(pyt)
            if not os.path.exists(pip):
                raise FileNotFoundError(pip)
コード例 #4
0
    def test_install_python_pyensae(self):
        fLOG(__file__, self._testMethodName, OutputPrint=True)
        vers = "%d%d" % sys.version_info[:2]
        temp = get_temp_folder(__file__,
                               "temp_python%s_pyensae" % vers,
                               clean=False)

        if sys.platform.startswith("win"):
            clog = CustomLog(temp)
            install_python(install=True,
                           temp_folder=temp,
                           fLOG=clog,
                           modules="pyensae",
                           custom=True,
                           latest=True,
                           download_folder=temp + "_download")
            pyt = os.path.join(temp, "python.exe")
            pip = os.path.join(temp, "Scripts", "pip.exe")
            if not os.path.exists(pyt):
                raise FileNotFoundError(pyt)
            if not os.path.exists(pip):
                raise FileNotFoundError(pip)