Remove unreferenced patterns and gradients outside of a defs

This commit is contained in:
JSCHILL1 2009-04-15 10:58:06 -05:00
parent 2cc9c00ef7
commit 066c627833
7 changed files with 640 additions and 7 deletions

View file

@ -120,5 +120,16 @@ class RemoveEmptyGElements(unittest.TestCase):
self.assertEquals(len(doc.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'g')), 1,
'Did not remove empty g element' )
class RemoveUnreferencedPattern(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/unreferenced-pattern.svg')
self.assertEquals(len(doc.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'pattern')), 0,
'Unreferenced pattern not removed' )
# These tests will fail at present
#class RemoveDuplicateGradientStops(unittest.TestCase):
# def runTest(self):
# doc = scour.scourXmlFile('unittests/duplicate-gradient-stops.svg')
if __name__ == '__main__':
unittest.main()