Another unit test for namespace declaration

This commit is contained in:
JSCHILL1 2009-08-12 09:51:18 -05:00
parent d4747e2bd7
commit d8b2497d91

View file

@ -857,11 +857,17 @@ class WellFormedXMLAmpersandInTextContent(unittest.TestCase):
self.assert_( wellformed.find('<desc>Peanut Butter &amp; Jelly</desc>') != -1, self.assert_( wellformed.find('<desc>Peanut Butter &amp; Jelly</desc>') != -1,
'Improperly serialized &amp; in text content') 'Improperly serialized &amp; in text content')
class NamespaceDeclPrefixesInXML(unittest.TestCase): class WellFormedXMLNamespacePrefix(unittest.TestCase):
def runTest(self):
wellformed = scour.scourString(open('unittests/xml-well-formed.svg').read())
self.assert_( wellformed.find('xmlns:foo=') != -1,
'Improperly serialized namespace prefix declarations')
class NamespaceDeclPrefixesInXMLWhenNotInDefaultNamespace(unittest.TestCase):
def runTest(self): def runTest(self):
xmlstring = scour.scourString(open('unittests/xml-ns-decl.svg').read()) xmlstring = scour.scourString(open('unittests/xml-ns-decl.svg').read())
self.assert_( xmlstring.find('xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"') != -1, self.assert_( xmlstring.find('xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"') != -1,
'Improperly serialized namespace prefix declarations') 'Improperly serialized namespace prefix declarations when not in default namespace')
# TODO; write a test for embedding rasters # TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters # TODO: write a test for --disable-embed-rasters
# TODO: write tests for --keep-editor-data # TODO: write tests for --keep-editor-data