Commit 871264ea authored by Andreas Jung's avatar Andreas Jung

added HTML regression test

parent 239e4415
...@@ -105,6 +105,8 @@ regressions=os.path.join(package_dir, 'regressions') ...@@ -105,6 +105,8 @@ regressions=os.path.join(package_dir, 'regressions')
files = ['index.stx','Acquisition.stx','ExtensionClass.stx', files = ['index.stx','Acquisition.stx','ExtensionClass.stx',
'MultiMapping.stx','examples.stx'] 'MultiMapping.stx','examples.stx']
reg_files = ['Links.stx']
def readFile(dirname,fname): def readFile(dirname,fname):
...@@ -165,12 +167,21 @@ class StructuredTextTests(unittest.TestCase): ...@@ -165,12 +167,21 @@ class StructuredTextTests(unittest.TestCase):
'HTML ClassicDocumentClass failed on %s' % f 'HTML ClassicDocumentClass failed on %s' % f
# def testRegressionsTests(self) def testRegressionsTests(self):
# """ there should be a regression tests that compares """ HTML regression test """
# generated HTML against the reference HTML files.
# This test is commented in the 2.4 branch because for f in reg_files:
# of the change from ST to STXNG and the changed Doc = DocumentClass.DocumentClass()
# HTML generation (HTML references files are no longer HTML = HTMLClass.HTMLClass()
# valid for STXNG) raw_text = readFile(regressions,f)
text = Doc(ST.StructuredText(raw_text))
html = HTML(text)
reg_fname = f.replace('.stx','.ref')
reg_html = readFile(regressions , reg_fname)
assert reg_html.strip()== html.strip(), \
'HTML regression test failed on %s' % f
framework() framework()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment