Add unit tests for removing fill attributes when fill=none
This commit is contained in:
parent
d9866c99e9
commit
0f1d0b104d
3 changed files with 18 additions and 0 deletions
3
scour.py
3
scour.py
|
|
@ -44,6 +44,9 @@
|
||||||
# * Process quadratic Bezier curves
|
# * Process quadratic Bezier curves
|
||||||
# * Collapse all group based transformations
|
# * Collapse all group based transformations
|
||||||
|
|
||||||
|
# Suggestion from Richard Hutch:
|
||||||
|
# * Put id attributes first in the serialization (or make the d attribute last)
|
||||||
|
|
||||||
# Next Up:
|
# Next Up:
|
||||||
# + fix bug when removing stroke styles
|
# + fix bug when removing stroke styles
|
||||||
# - Convert all colors to #RRGGBB format
|
# - Convert all colors to #RRGGBB format
|
||||||
|
|
|
||||||
12
testscour.py
12
testscour.py
|
|
@ -340,6 +340,18 @@ class RemoveStrokeDashoffsetWhenStrokeNone(unittest.TestCase):
|
||||||
self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('stroke-dashoffset'), '',
|
self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('stroke-dashoffset'), '',
|
||||||
"stroke-dashoffset attribute not emptied when no stroke" )
|
"stroke-dashoffset attribute not emptied when no stroke" )
|
||||||
|
|
||||||
|
class RemoveFillRuleWhenFillNone(unittest.TestCase):
|
||||||
|
def runTest(self):
|
||||||
|
doc = scour.scourXmlFile('unittests/fill-none.svg')
|
||||||
|
self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('fill-rule'), '',
|
||||||
|
"fill-rule attribute not emptied when no fill" )
|
||||||
|
|
||||||
|
class RemoveFillOpacityWhenFillNone(unittest.TestCase):
|
||||||
|
def runTest(self):
|
||||||
|
doc = scour.scourXmlFile('unittests/fill-none.svg')
|
||||||
|
self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('fill-opacity'), '',
|
||||||
|
"fill-opacity attribute not emptied when no fill" )
|
||||||
|
|
||||||
#class RemoveUnreferencedFonts(unittest.TestCase):
|
#class RemoveUnreferencedFonts(unittest.TestCase):
|
||||||
# def runTest(self):
|
# def runTest(self):
|
||||||
# doc = scour.scourXmlFile('unittests/unreferenced-font.svg')
|
# doc = scour.scourXmlFile('unittests/unreferenced-font.svg')
|
||||||
|
|
|
||||||
3
unittests/fill-none.svg
Normal file
3
unittests/fill-none.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path id="p" style="fill: none; fill-rule: evenodd; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 217 B |
Loading…
Add table
Add a link
Reference in a new issue