SF.net SVN: docutils:[9911] trunk/docutils/test

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9911
          http://sourceforge.net/p/docutils/code/9911
Author:   milde
Date:     2024-08-21 08:05:47 +0000 (Wed, 21 Aug 2024)
Log Message:
-----------
Revert test template file extension from "rst" to "txt".

A test sample of a custom HTML template files got accidentially
renamed to "full-template.rst". However, it is not reStructuredText.

Fixup for [r9906].

Modified Paths:
--------------
    trunk/docutils/test/test_writers/test_html4css1_template.py
    trunk/docutils/test/test_writers/test_html5_template.py

Added Paths:
-----------
    trunk/docutils/test/data/full-template.txt

Removed Paths:
-------------
    trunk/docutils/test/data/full-template.rst

Deleted: trunk/docutils/test/data/full-template.rst
===================================================================
--- trunk/docutils/test/data/full-template.rst	2024-08-18 14:56:56 UTC (rev 9910)
+++ trunk/docutils/test/data/full-template.rst	2024-08-21 08:05:47 UTC (rev 9911)
@@ -1,106 +0,0 @@
-head_prefix = """\
-%(head_prefix)s"""
-
-
-head = """\
-%(head)s"""
-
-
-stylesheet = """\
-%(stylesheet)s"""
-
-
-body_prefix = """\
-%(body_prefix)s"""
-
-
-body_pre_docinfo = """\
-%(body_pre_docinfo)s"""
-
-
-docinfo = """\
-%(docinfo)s"""
-
-
-body = """\
-%(body)s"""
-
-
-body_suffix = """\
-%(body_suffix)s"""
-
-
-head_prefix = """\
-%(head_prefix)s"""
-
-
-head = """\
-%(head)s"""
-
-
-stylesheet = """\
-%(stylesheet)s"""
-
-
-body_prefix = """\
-%(body_prefix)s"""
-
-
-body_pre_docinfo = """\
-%(body_pre_docinfo)s"""
-
-
-docinfo = """\
-%(docinfo)s"""
-
-
-body = """\
-%(body)s"""
-
-
-body_suffix = """\
-%(body_suffix)s"""
-
-
-title = """\
-%(title)s"""
-
-
-subtitle = """\
-%(subtitle)s"""
-
-
-header = """\
-%(header)s"""
-
-
-footer = """\
-%(footer)s"""
-
-
-meta = """\
-%(meta)s"""
-
-
-fragment = """\
-%(fragment)s"""
-
-
-html_prolog = """\
-%(html_prolog)s"""
-
-
-html_head = """\
-%(html_head)s"""
-
-
-html_title = """\
-%(html_title)s"""
-
-
-html_subtitle = """\
-%(html_subtitle)s"""
-
-
-html_body = """\
-%(html_body)s"""

Copied: trunk/docutils/test/data/full-template.txt (from rev 9910, trunk/docutils/test/data/full-template.rst)
===================================================================
--- trunk/docutils/test/data/full-template.txt	                        (rev 0)
+++ trunk/docutils/test/data/full-template.txt	2024-08-21 08:05:47 UTC (rev 9911)
@@ -0,0 +1,106 @@
+head_prefix = """\
+%(head_prefix)s"""
+
+
+head = """\
+%(head)s"""
+
+
+stylesheet = """\
+%(stylesheet)s"""
+
+
+body_prefix = """\
+%(body_prefix)s"""
+
+
+body_pre_docinfo = """\
+%(body_pre_docinfo)s"""
+
+
+docinfo = """\
+%(docinfo)s"""
+
+
+body = """\
+%(body)s"""
+
+
+body_suffix = """\
+%(body_suffix)s"""
+
+
+head_prefix = """\
+%(head_prefix)s"""
+
+
+head = """\
+%(head)s"""
+
+
+stylesheet = """\
+%(stylesheet)s"""
+
+
+body_prefix = """\
+%(body_prefix)s"""
+
+
+body_pre_docinfo = """\
+%(body_pre_docinfo)s"""
+
+
+docinfo = """\
+%(docinfo)s"""
+
+
+body = """\
+%(body)s"""
+
+
+body_suffix = """\
+%(body_suffix)s"""
+
+
+title = """\
+%(title)s"""
+
+
+subtitle = """\
+%(subtitle)s"""
+
+
+header = """\
+%(header)s"""
+
+
+footer = """\
+%(footer)s"""
+
+
+meta = """\
+%(meta)s"""
+
+
+fragment = """\
+%(fragment)s"""
+
+
+html_prolog = """\
+%(html_prolog)s"""
+
+
+html_head = """\
+%(html_head)s"""
+
+
+html_title = """\
+%(html_title)s"""
+
+
+html_subtitle = """\
+%(html_subtitle)s"""
+
+
+html_body = """\
+%(html_body)s"""

Modified: trunk/docutils/test/test_writers/test_html4css1_template.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_template.py	2024-08-18 14:56:56 UTC (rev 9910)
+++ trunk/docutils/test/test_writers/test_html4css1_template.py	2024-08-21 08:05:47 UTC (rev 9911)
@@ -30,7 +30,7 @@
     # maxDiff = None
     def test_publish(self):
         writer = 'html4'
-        template_path = TEST_ROOT / 'data/full-template.rst'
+        template_path = TEST_ROOT / 'data/full-template.txt'
         for name, cases in totest.items():
             for casenum, (case_input, case_expected) in enumerate(cases):
                 with self.subTest(id=f'totest[{name!r}][{casenum}]'):

Modified: trunk/docutils/test/test_writers/test_html5_template.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_template.py	2024-08-18 14:56:56 UTC (rev 9910)
+++ trunk/docutils/test/test_writers/test_html5_template.py	2024-08-21 08:05:47 UTC (rev 9911)
@@ -21,6 +21,7 @@
 
 import docutils
 from docutils.core import publish_string
+from docutils.writers import html5_polyglot
 
 # TEST_ROOT is ./test/ from the docutils root
 TEST_ROOT = Path(__file__).parents[1]
@@ -29,14 +30,13 @@
 class WriterPublishTestCase(unittest.TestCase):
     # maxDiff = None
     def test_publish(self):
-        writer = 'html5'
-        template_path = TEST_ROOT / 'data/full-template.rst'
+        template_path = TEST_ROOT / 'data/full-template.txt'
         for name, cases in totest.items():
             for casenum, (case_input, case_expected) in enumerate(cases):
                 with self.subTest(id=f'totest[{name!r}][{casenum}]'):
                     output = publish_string(
                         source=case_input,
-                        writer=writer,
+                        writer=html5_polyglot.Writer(),
                         settings_overrides={
                             '_disable_config': True,
                             'strict_visitor': True,

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.