Prevent fonts from being removed inside a <defs>

This commit is contained in:
JSCHILL1 2009-04-19 08:08:37 -05:00
parent 72363ec24b
commit 8d0bb8fe55
4 changed files with 47 additions and 1 deletions

View file

@ -195,6 +195,19 @@ class NoInkscapeAttributes(unittest.TestCase):
findInkscapeAttr), False,
'Found Inkscape attributes' )
class KeepReferencedFonts(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/referenced-font.svg')
fonts = doc.documentElement.getElementsByTagNameNS('http://www.w3.org/2000/svg','font')
self.assertEquals(len(fonts), 1,
"Font wrongly removed from <defs>" )
class RemoveUnreferencedFonts(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/unreferenced-font.svg')
fonts = doc.documentElement.getElementsByTagNameNS('http://www.w3.org/2000/svg','font')
self.assertEquals(len(fonts), 0,
"Font was not removed from <defs>" )
if __name__ == '__main__':
unittest.main()