test.test_writers.test_html4css1_template.py Maven / Gradle / Ivy
#!/usr/bin/env python
# $Id: test_html4css1_template.py 6379 2010-07-19 16:07:19Z goodger $
# Author: David Goodger
# Copyright: This module has been placed in the public domain.
"""
Tests for the HTML writer.
"""
import os
from __init__ import DocutilsTestSupport
def suite():
settings = {'template': os.path.join(DocutilsTestSupport.testroot,
'data', 'full-template.txt'),
'embed_stylesheet': 0,}
s = DocutilsTestSupport.PublishTestSuite('html', suite_settings=settings)
s.generateTests(totest)
return s
totest = {}
totest['template'] = [
["""\
================
Document Title
================
----------
Subtitle
----------
:Author: Me
.. footer:: footer text
Section
=======
Some text.
""",
r'''head_prefix = """\
"""
head = """\
Document Title
"""
stylesheet = """\
"""
body_prefix = """\
"""
body_pre_docinfo = """\
Document Title
Subtitle
"""
docinfo = """\
Author:
Me
"""
body = """\
Section
Some text.
"""
body_suffix = """\
"""
head_prefix = """\
"""
head = """\
Document Title
"""
stylesheet = """\
"""
body_prefix = """\
"""
body_pre_docinfo = """\
Document Title
Subtitle
"""
docinfo = """\
Author:
Me
"""
body = """\
Section
Some text.
"""
body_suffix = """\
"""
title = """\
Document Title"""
subtitle = """\
Subtitle"""
header = """\
"""
footer = """\
"""
meta = """\
"""
fragment = """\
Section
Some text.
"""
html_prolog = """\
"""
html_head = """\
Document Title
"""
html_title = """\
Document Title
"""
html_subtitle = """\
Subtitle
"""
html_body = """\
Document Title
Subtitle
Author:
Me
Section
Some text.
"""
''' % {'version': DocutilsTestSupport.docutils.__version__}]
]
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')