From 249771bcccaa210c2eb83e8e6beef033e83f7809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Sat, 24 Mar 2018 23:53:26 +0100 Subject: [PATCH] fix unit test --- HISTORY.rst | 60 +++++++++---------- ...test_full_documentation_module_template.py | 2 +- .../ut_loghelper/test_history_helper.py | 2 +- .../helpgen/sphinx_main_helper.py | 3 +- src/pyquickhelper/loghelper/pypi_helper.py | 4 +- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d634355de..8b158d98b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,57 +6,57 @@ History current - 2018-03-24 - 0.00Mb ============================= -* `114`: automatically builds history with release and issues + add command history in setup (2018-03-24) +* `114`: automatically builds history with release and issues + add command history in setup (2018-03-24) 1.7.2482 - 2018-03-22 - 1.99Mb ============================== -* `111`: enable manual snippet for notebook, repace add_notebook_menu by toctree in sphinx (2018-03-20) +* `111`: enable manual snippet for notebook, repace add_notebook_menu by toctree in sphinx (2018-03-20) 1.7.2468 - 2018-03-19 - 1.99Mb ============================== -* `113`: propose a fix for a bug introduced by pip 9.0.2 (2018-03-19) -* `112`: allow to set custom snippets for notebooks (2018-03-15) -* `109`: run javascript producing svg and convert it into png (2018-03-15) -* `107`: convert svg into png for notebook snippets (2018-03-12) -* `108`: add command lab, creates a script to start jupyter lab on notebook folder (2018-03-10) +* `113`: propose a fix for a bug introduced by pip 9.0.2 (2018-03-19) +* `112`: allow to set custom snippets for notebooks (2018-03-15) +* `109`: run javascript producing svg and convert it into png (2018-03-15) +* `107`: convert svg into png for notebook snippets (2018-03-12) +* `108`: add command lab, creates a script to start jupyter lab on notebook folder (2018-03-10) 1.7.2448 - 2018-03-03 - 1.98Mb ============================== -* `106`: replace pdflatex by xelatex to handle utf-8 (2018-03-03) -* `104`: implement visit, depart for pending_xref and rst translator (2018-03-01) -* `103`: fix import issue for Sphinx 1.7.1 (2018-03-01) -* `102`: fix sphinx command line (2018-02-24) +* `106`: replace pdflatex by xelatex to handle utf-8 (2018-03-03) +* `104`: implement visit, depart for pending_xref and rst translator (2018-03-01) +* `103`: fix import issue for Sphinx 1.7.1 (2018-03-01) +* `102`: fix sphinx command line (2018-02-24) 1.7.2438 - 2018-02-23 - 1.98Mb ============================== -* `101`: migrate to sphinx 1.7 (2018-02-13) +* `101`: migrate to sphinx 1.7 (2018-02-13) 1.6.2413 - 2018-02-13 - 1.98Mb ============================== -* `100`: fix indentation when copying the sources in documentation repository (2018-02-04) -* `98`: deal .. only:: html for readme.rst when copying it to the source repository (2018-01-31) -* `96`: remove some automated part from the produced latex (2018-01-30) -* `99`: bug with galleries of examples with multiple subfolders (2018-01-30) -* `95`: fix ? replacing accents in latex output (2018-01-29) -* `94`: add text fixture for continuous integration (2018-01-28) -* `93`: add custom replacements before converting notebooks (2018-01-19) -* `92`: add directive video to sphinx (2018-01-15) -* `89`: add extension doc8 to check documentation style (2017-12-21) -* `86`: check why the last line of a notebook does not appear when converted to rst in the documentation (2017-12-15) -* `85`: rename cmdref function name (like in setup) (2017-12-04) -* `84`: remove :epkg: instruction in call_cli_function (2017-12-02) -* `75`: fix bug in notebook coverage: notebook are duplicated (2017-12-02) +* `100`: fix indentation when copying the sources in documentation repository (2018-02-04) +* `98`: deal .. only:: html for readme.rst when copying it to the source repository (2018-01-31) +* `96`: remove some automated part from the produced latex (2018-01-30) +* `99`: bug with galleries of examples with multiple subfolders (2018-01-30) +* `95`: fix ? replacing accents in latex output (2018-01-29) +* `94`: add text fixture for continuous integration (2018-01-28) +* `93`: add custom replacements before converting notebooks (2018-01-19) +* `92`: add directive video to sphinx (2018-01-15) +* `89`: add extension doc8 to check documentation style (2017-12-21) +* `86`: check why the last line of a notebook does not appear when converted to rst in the documentation (2017-12-15) +* `85`: rename cmdref function name (like in setup) (2017-12-04) +* `84`: remove :epkg: instruction in call_cli_function (2017-12-02) +* `75`: fix bug in notebook coverage: notebook are duplicated (2017-12-02) 1.5.2275 - 2017-11-28 - 0.50Mb ============================== -* `81`: add youtube extension (2017-10-06) -* `79`: fix image copy for blogs (2017-09-20) -* `78`: get_temp_folder change other default directory (2017-09-20) -* `77`: add class UnitTest with extensive test function (2017-09-20) -* `76`: report time for the whole generation (2017-09-16) +* `81`: add youtube extension (2017-10-06) +* `79`: fix image copy for blogs (2017-09-20) +* `78`: get_temp_folder change other default directory (2017-09-20) +* `77`: add class UnitTest with extensive test function (2017-09-20) +* `76`: report time for the whole generation (2017-09-16) diff --git a/_unittests/ut_helpgen/test_full_documentation_module_template.py b/_unittests/ut_helpgen/test_full_documentation_module_template.py index 2ed90f955..d9babb305 100644 --- a/_unittests/ut_helpgen/test_full_documentation_module_template.py +++ b/_unittests/ut_helpgen/test_full_documentation_module_template.py @@ -23,7 +23,7 @@ sys.path.append(path) import src -from src.pyquickhelper.loghelper.flog import fLOG, download, noLOG +from src.pyquickhelper.loghelper.flog import fLOG, download from src.pyquickhelper.helpgen import generate_help_sphinx from src.pyquickhelper.pycode import get_temp_folder from src.pyquickhelper.pycode import is_travis_or_appveyor diff --git a/_unittests/ut_loghelper/test_history_helper.py b/_unittests/ut_loghelper/test_history_helper.py index fd1165726..79958cb89 100644 --- a/_unittests/ut_loghelper/test_history_helper.py +++ b/_unittests/ut_loghelper/test_history_helper.py @@ -98,7 +98,7 @@ def test_history(self): self.assertGreater(nb, 1) output = compile_history(history) - self.assertIn('* - `101`:', output) + self.assertIn('* `101`:', output) self.assertIn('1.7.2482 - 2018-03-22 - 1.99Mb', output) diff --git a/src/pyquickhelper/helpgen/sphinx_main_helper.py b/src/pyquickhelper/helpgen/sphinx_main_helper.py index f38be336e..09a6ad78c 100644 --- a/src/pyquickhelper/helpgen/sphinx_main_helper.py +++ b/src/pyquickhelper/helpgen/sphinx_main_helper.py @@ -483,8 +483,7 @@ def format_history(src, dest): nline = line.lstrip("* ") if nline.startswith("`"): if tag is None: - raise ValueError( - "Line {0}: '{1}', tag is None, no line '**' was found in this release.".format(i, line)) + tag = 'issue' res = "* :{0}:{1}".format(tag, nline) if new_lines[-1].startswith("==="): new_lines.append("") diff --git a/src/pyquickhelper/loghelper/pypi_helper.py b/src/pyquickhelper/loghelper/pypi_helper.py index 0236d9372..61761e908 100644 --- a/src/pyquickhelper/loghelper/pypi_helper.py +++ b/src/pyquickhelper/loghelper/pypi_helper.py @@ -20,9 +20,9 @@ def enumerate_pypi_versions_date(name, url='https://pypi.python.org/pypi'): @return list tuple (date, version, size) """ pypi = xmlrpc_client.ServerProxy(url) - available = pypi.package_releases('pyquickhelper', True) + available = pypi.package_releases(name, True) for ver in available: - res = pypi.release_urls('pyquickhelper', ver) + res = pypi.release_urls(name, ver) for r in res: yield datetime(* tuple(r['upload_time'].timetuple())[:6]), ver, r['size'] break