1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Description: improve test_parse, get rid of hardcoded docutils version
Origin: https://github.com/regebro/hovercraft/commit/800e22a
Bug: https://github.com/regebro/hovercraft/issues/122
Bug-Debian: https://bugs.debian.org/848034
--- a/hovercraft/tests/test_parse.py
+++ b/hovercraft/tests/test_parse.py
@@ -105,11 +105,11 @@ class SlideMakerTests(unittest.TestCase):
b'....\n\nLevel 3\n\n----\n\nLevel 2\n\n....\n\nLevel 3\n\n'
b'====\n\nLevel 1')
- target = (
+ target_start = (
b'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE document PUBLIC "+'
b'//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" '
- b'"http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n'
- b'<!-- Generated by Docutils 0.12 -->\n'
+ b'"http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
+ target_end = (
b'<document source="<string>"><paragraph>Intro</paragraph>'
b'<transition level="1"></transition><paragraph>Level 1</paragraph>'
b'<transition level="1"></transition><paragraph>Level 1</paragraph>'
@@ -118,9 +118,9 @@ class SlideMakerTests(unittest.TestCase):
b'<transition level="2"></transition><paragraph>Level 2</paragraph>'
b'<transition level="3"></transition><paragraph>Level 3</paragraph>'
b'<transition level="1"></transition><paragraph>Level 1</paragraph>'
- b'</document>'
- )
- self.assertEqual(xml, target)
+ b'</document>')
+ self.assertTrue(xml.startswith(target_start))
+ self.assertTrue(xml.endswith(target_end))
# Make the slides:
tree = SlideMaker(etree.fromstring(xml)).walk()
|