Esempio n. 1
0
 def test_changes(self) :
     fLOG (__file__, self._testMethodName, OutputPrint = __name__ == "__main__")
     path = os.path.abspath(os.path.split(__file__)[0])
     fold = os.path.join(path, "..","..","..","ensae_teaching_cs")
     if os.path.exists(fold):
         file = os.path.join(path, "out_table.rst")
         if os.path.exists(file) : os.remove(file)
         generate_changes_repo(file, fold)
         with open(file, "r", encoding="utf8") as f : content = f.readlines()
         ls = [ len(_) for _ in content ]
         ml = max ( ls )
         total = [ l for l in ls if ml-100 <= l < ml ]
         assert len(ls)>0 and len(total)==0
     else :
         fLOG("sorry, fixing a specific case on another project for accent problem")
 def test_sphinx_changes(self) :
     fLOG (__file__, self._testMethodName, OutputPrint = __name__ == "__main__")
     path    = os.path.abspath(os.path.split(__file__)[0])
     file    = os.path.normpath(os.path.join(path, "..", ".."))
     assert os.path.exists(file)
     fLOG(file)
     
     rst     = generate_changes_repo(None, file)
     fLOG(rst)
     assert len(rst)>0
     assert "pyquickhelper" in rst
Esempio n. 3
0
    def test_changes(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        path = os.path.abspath(os.path.split(__file__)[0])
        fold = os.path.join(path, "..", "..")
        if sys.version_info[0] == 2:
            fold = os.path.join(fold, "..")
        fold = os.path.normpath(fold)
        if os.path.exists(fold):
            fLOG("exists", fold)
            file = os.path.join(path, "out_table.rst")
            if os.path.exists(file):
                os.remove(file)

            if sys.version_info[0] == 2:
                # encoding, encoding...
                return

            def modifiy_commit(nbch, date, author, comment):
                return nbch, date, author, comment

            generate_changes_repo(file, fold)
            with open(file, "r", encoding="utf8") as f:
                content = f.read()
            assert ".. plot::" in content
            content = content[
                content.find("List of recent changes:"):].split("\n")
            ls = [len(_) for _ in content]
            ml = max(ls)
            total = [l for l in ls if ml - 100 <= l < ml]
            assert len(ls) > 0 and len(total) == 0
        else:
            fLOG(
                "sorry, fixing a specific case on another project for accent problem")
    def test_sphinx_changes(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")
        path = os.path.abspath(os.path.split(__file__)[0])
        file = os.path.normpath(os.path.join(path, "..", ".."))
        assert os.path.exists(file)
        fLOG(file)

        if sys.version_info[0] == 2:
            return

        rst = generate_changes_repo(None, file)
        fLOG(rst)
        assert len(rst) > 0
        if "+-----------------------" not in rst:
            raise Exception(
                "+----------------------- not in rst:\n" +
                str(rst))