Add unittests for 1cde426009 and 641d2db08a392e4a7df20c700e1accb9cd8d1341

This commit is contained in:
Eduard Braun 2016-09-11 00:16:17 +02:00
parent 0b5bb5184c
commit 10e687b887
2 changed files with 31 additions and 1 deletions

View file

@ -495,12 +495,30 @@ class RemoveStrokeWhenStrokeNone(unittest.TestCase):
self.assertEqual(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('stroke'), '',
'stroke attribute not emptied when no stroke' )
class KeepStrokeWhenInheritedFromParent(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/stroke-none.svg')
self.assertEqual(doc.getElementById('p1').getAttribute('stroke'), 'none',
'stroke attribute removed despite a different value being inherited from a parent' )
class KeepStrokeWhenInheritedByChild(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/stroke-none.svg')
self.assertEqual(doc.getElementById('g2').getAttribute('stroke'), 'none',
'stroke attribute removed despite it being inherited by a child' )
class RemoveStrokeWidthWhenStrokeNone(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/stroke-none.svg')
self.assertEqual(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('stroke-width'), '',
'stroke-width attribute not emptied when no stroke' )
class KeepStrokeWidthWhenInheritedByChild(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/stroke-none.svg')
self.assertEqual(doc.getElementById('g3').getAttribute('stroke-width'), '1px',
'stroke-width attribute removed despite it being inherited by a child' )
class RemoveStrokeOpacityWhenStrokeNone(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/stroke-none.svg')