Пример #1
0
def test_pep257():
    """This is PEP257 formated documentation.

    So question is, how it will be formated.
    """
    assert (
        "<p>This is PEP257 formated documentation.</p>\n\n" + "<p>So question is, how it will be formated.</p>"
        == rst(cleandoc(test_pep257.__doc__))
    )
Пример #2
0
def test_more():
    doc = "first line\n\nsecond line"
    html = "<p>first line</p>\n\n<p>second line</p>"
    assert html == rst(doc)
Пример #3
0
def test_simple():
    assert "simple" == rst("simple")
Пример #4
0
def test_file():
    with open("examples/test.rst") as src:
        doc = src.read()
    with open("examples/out/test.html", "w+") as out:
        out.write(rst(doc))
Пример #5
0
def test_header():
    """Testing header

    Header
    ------
    Text
    """
    assert '<p>Testing header</p>\n\n\n<a name="header"></a><h1>Header</h1>\n<p>Text</p>' == rst(
        cleandoc(test_header.__doc__), section_level=0
    )