Final scour 0.18: more fixes to XML serialization (wellformedness), some unit tests, update to package script to use zip file and to package the inkscape extension

This commit is contained in:
JSCHILL1 2009-08-09 22:25:20 -05:00
parent 5f5c8a431d
commit eb2a7a05ac
6 changed files with 60 additions and 7 deletions

View file

@ -833,6 +833,30 @@ class CDATAInXml(unittest.TestCase):
</svg>''',
'Improperly serialized the cdata unit tests')
class WellFormedXMLLesserThanInAttrValue(unittest.TestCase):
def runTest(self):
wellformed = scour.scourString(open('unittests/xml-well-formed.svg').read())
self.assert_( wellformed.find('unicode="&lt;"') != -1,
"Improperly serialized &lt; in attribute value")
class WellFormedXMLAmpersandInAttrValue(unittest.TestCase):
def runTest(self):
wellformed = scour.scourString(open('unittests/xml-well-formed.svg').read())
self.assert_( wellformed.find('unicode="&amp;"') != -1,
'Improperly serialized &amp; in attribute value' )
class WellFormedXMLLesserThanInTextContent(unittest.TestCase):
def runTest(self):
wellformed = scour.scourString(open('unittests/xml-well-formed.svg').read())
self.assert_( wellformed.find('<title>2 &lt; 5</title>') != -1,
'Improperly serialized &lt; in text content')
class WellFormedXMLAmpersandInTextContent(unittest.TestCase):
def runTest(self):
wellformed = scour.scourString(open('unittests/xml-well-formed.svg').read())
self.assert_( wellformed.find('<desc>Peanut Butter &amp; Jelly</desc>') != -1,
'Improperly serialized &amp; in text content')
# TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters
# TODO: write tests for --keep-editor-data