def test_script_help(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") if is_travis_or_appveyor() == "travis": warnings.warn("run_cmd no end on travis") return script = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_install.py") if not os.path.exists(script): raise Exception(script) scriptu = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_update.py") if not os.path.exists(script): raise Exception(script) exe = sys.executable cmd = exe + " " + script + " --help" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) if "usage: pymy_install.py" not in out: raise Exception(out) cmd = exe + " " + scriptu + " --help" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) if "usage: pymy_update.py" not in out: if is_travis_or_appveyor() == "appveyor": warnings.warn( "CLI ISSUE cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err)) else: raise Exception( "cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err))
def test_script_schedule(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") if is_travis_or_appveyor() == "travis": warnings.warn("run_cmd no end on travis") return script = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_install.py") assert os.path.exists(script) scriptu = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_update.py") assert os.path.exists(script) exe = sys.executable cmd = exe + " " + script + " --schedule --set=minimal --source=2" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) fLOG(out) fLOG("---") fLOG(err) if "[install-check] flake8" not in out and sys.version_info[0] > 2: if is_travis_or_appveyor() == "appveyor": warnings.warn( "CLI ISSUE cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err)) else: raise Exception( "cmd:\n{0}\nOUT:\n{1}\nERR\n{2}\nFOUND STRING\n{3}".format(cmd, out, err, "[install-check] flake8" not in out)) cmd = exe + " " + scriptu + " --schedule --set=minimal --source=2" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) if "[update-check] flake8" not in out and sys.version_info[0] > 2: if is_travis_or_appveyor() == "appveyor": warnings.warn( "CLI ISSUE cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err)) else: raise Exception( "cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err))
def test_script_schedule(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") if is_travis_or_appveyor() == "travis": warnings.warn("run_cmd no end on travis") return script = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_install.py") self.assertTrue(os.path.exists(script)) scriptu = os.path.join(os.path.dirname(os.path.abspath( __file__)), "..", "..", "src", "pymyinstall", "cli", "pymy_update.py") self.assertTrue(os.path.exists(script)) exe = sys.executable cmd = exe + " " + script + " --schedule --set=minimal --source=2" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) fLOG(out) fLOG("---") fLOG(err) if "[install-check] ## flake8 ## [begin]" not in out and sys.version_info[0] > 2: if is_travis_or_appveyor() == "appveyor": warnings.warn( "CLI ISSUE cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err)) else: raise Exception( "cmd:\n{0}\nOUT:\n{1}\nERR\n{2}\nFOUND STRING\n{3}".format(cmd, out, err, "[install-check] flake8" not in out)) cmd = exe + " " + scriptu + " --schedule --set=minimal --source=2" out, err = run_cmd(cmd, wait=True, fLOG=fLOG) if "[update-check] ## flake8 ## [begin]" not in out and sys.version_info[0] > 2: if is_travis_or_appveyor() == "appveyor": warnings.warn( "CLI ISSUE cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err)) else: raise Exception( "cmd:\n{0}\nOUT:\n{1}\nERR\n{2}".format(cmd, out, err))