Fix up tests, and make div valid.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Oliver Marks 2019-01-13 21:28:34 +00:00
parent 9b61640ba5
commit e216e0a98a
3 changed files with 6 additions and 5 deletions

View File

@ -155,7 +155,8 @@ def handle_token(doc, item, root=False):
def html(doc):
response = StringIO('<div class="org-body">')
response = StringIO()
response.write('<div class="org-body">')
for item in doc:
response.write(handle_token(doc, item, True))
response.write('</div>')

View File

@ -24,7 +24,7 @@ def test_html_output():
print(htmlbody)
assert (
htmlbody
== """<h2> Header 1</h2>
== """<div class="org-body"><h2> Header 1</h2>
<h3> Sub Header 1</h3>
<p class="flow-text">body <code>text</code>
over multiple <b>lines</b>
@ -34,5 +34,5 @@ def test_html_output():
</pre></div>
</td></tr></table><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">(</span><span class="nv">test</span> <span class="nv">code</span><span class="p">)</span>
</pre></div>
</td></tr></table>"""
</td></tr></table></div>"""
)

View File

@ -7,7 +7,7 @@ from eorg.generate import html
def test_bullet_block():
expected = """<ul class="browser-default"><li class="collection-item">Bullet 1</li><li class="collection-item">Bullet 2</li></ul>"""
expected = """<div class="org-body"><ul class="browser-default"><li class="collection-item">Bullet 1</li><li class="collection-item">Bullet 2</li></ul></div>"""
result = html(parse(snippets.bullet_plus_snippet).doc)
assert result.read() == expected
@ -33,4 +33,4 @@ def test_render_results():
assert tags[1].value[1].value == expected[1].value
htmlbody = html(tags).read()
assert htmlbody == '<img style="margin:auto;" src="test.png" alt="" />'
assert htmlbody == '<div class="org-body"><img style="margin:auto;" src="test.png" alt="" /></div>'