From e216e0a98a6409e00d1ee0625a11f7eecfe0ed01 Mon Sep 17 00:00:00 2001 From: Oliver Marks Date: Sun, 13 Jan 2019 21:28:34 +0000 Subject: [PATCH] Fix up tests, and make div valid. --- eorg/generate.py | 3 ++- tests/test_documents.py | 4 ++-- tests/test_html.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/eorg/generate.py b/eorg/generate.py index 703b9f9..3dab2e6 100644 --- a/eorg/generate.py +++ b/eorg/generate.py @@ -155,7 +155,8 @@ def handle_token(doc, item, root=False): def html(doc): - response = StringIO('
') + response = StringIO() + response.write('
') for item in doc: response.write(handle_token(doc, item, True)) response.write('
') diff --git a/tests/test_documents.py b/tests/test_documents.py index 92226a3..830b62e 100755 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -24,7 +24,7 @@ def test_html_output(): print(htmlbody) assert ( htmlbody - == """

Header 1

+ == """

Header 1

Sub Header 1

body text over multiple lines @@ -34,5 +34,5 @@ def test_html_output():

1
(test code)
 
-
""" +
""" ) diff --git a/tests/test_html.py b/tests/test_html.py index 038afc7..cd83ebc 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -7,7 +7,7 @@ from eorg.generate import html def test_bullet_block(): - expected = """""" + expected = """
""" 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 == '' + assert htmlbody == '
'