def test_doctring2html(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     html = docstring2html(df2rst, "rawhtml", fLOG=fLOG)
     assert len(html) > 0
     assert "<p>&#64;code" not in html
     html = docstring2html(df2rst, "html", fLOG=fLOG)
     assert isinstance(html, HTML)
 def test_doctring2html_pandas(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     html = docstring2html(pandas.read_csv, "rawhtml", fLOG=fLOG)
     assert len(html) > 0
 def test_doctring2html_sklearn(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     try:
         import sklearn.linear_model
     except ImportError:
         return
     html = docstring2html(
         sklearn.linear_model.LogisticRegression,
         "rawhtml",
         fLOG=fLOG)
     assert len(html) > 0
     if '<div class="system-message">' in html:
         raise Exception(html)
Пример #4
0
    def test_object(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        class AA:
            """one doc"""

            def __init__(self):
                """constructor"""
                pass

            @property
            def g(self):
                """g"""
                return ""

            @staticmethod
            def st():
                """st"""
                return ""

        rst = docstring2html(pandas)
        assert rst is not None
        rst = docstring2html(AA)
        assert rst is not None
        rst = docstring2html(3)
        assert rst is not None
        rst = docstring2html(AA().__class__)
        assert rst is not None
        rst = docstring2html(AA.__init__)
        assert rst is not None
        rst = docstring2html(AA.g)
        assert rst is not None
        rst = docstring2html(AA.st)
        assert rst is not None
        rst = docstring2html(self)
        assert rst is not None