def test_rst_to_html():
rst = (
"Section\n"
"=======\n\n"
"**Some strong text**\n\n"
"Subsection\n"
"----------\n\n"
"* This is a bulleted list.\n"
"* It has two items, the second\n"
" item uses two lines.\n"
"\n"
"1. This is a numbered list.\n"
"2. It has two items too.\n"
"\n"
"#. This is a numbered list.\n"
"#. It has two items too.\n"
)
expected_html = (
'<div class="swh-rst"><h1 class="title">Section</h1>\n'
"<p><strong>Some strong text</strong></p>\n"
'<div class="section" id="subsection">\n'
"<h2>Subsection</h2>\n"
'<ul class="simple">\n'
"<li><p>This is a bulleted list.</p></li>\n"
"<li><p>It has two items, the second\n"
"item uses two lines.</p></li>\n"
"</ul>\n"
'<ol class="arabic simple">\n'
"<li><p>This is a numbered list.</p></li>\n"
"<li><p>It has two items too.</p></li>\n"
"<li><p>This is a numbered list.</p></li>\n"
"<li><p>It has two items too.</p></li>\n"
"</ol>\n"
"</div>\n"
"</div>"
)
> assert utils.rst_to_html(rst) == expected_html
E assert '<div class="...tion>\n</div>' == '<div class=".../div>\n</div>'
E <div class="swh-rst"><h1 class="title">Section</h1>
E <p><strong>Some strong text</strong></p>
E - <div class="section" id="subsection">
E ? ----------- -
E + <section id="subsection">
E <h2>Subsection</h2>
E <ul class="simple">...
E
E ...Full output truncated (14 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_utils.py:145: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 7 2021, 11:44 AM