Add closepath test
This commit is contained in:
parent
06f008a908
commit
f1f0aab965
4 changed files with 23 additions and 2 deletions
|
|
@ -13,10 +13,11 @@
|
||||||
<header>
|
<header>
|
||||||
<h2><a href="#0.15">Version 0.15</a></h2>
|
<h2><a href="#0.15">Version 0.15</a></h2>
|
||||||
</header>
|
</header>
|
||||||
<p>July 4th, 2009</p>
|
<p>July 5th, 2009</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>added --keep-editor-data command-line option</li>
|
<li>added --keep-editor-data command-line option</li>
|
||||||
<li>Fix Bug 395645: Keep all identified children inside a defs (Thanks Frederik!)</li>
|
<li>Fix Bug 395645: Keep all identified children inside a defs (Thanks Frederik!)</li>
|
||||||
|
<li>Fix Bug 395647: Do not remove closepath (Z) path segments</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -600,7 +600,13 @@ class DoNotRemoveGroupsWithIDsInDefs(unittest.TestCase):
|
||||||
def runTest(self):
|
def runTest(self):
|
||||||
f = scour.scourXmlFile('unittests/important-groups-in-defs.svg')
|
f = scour.scourXmlFile('unittests/important-groups-in-defs.svg')
|
||||||
self.assertEquals(len(f.getElementsByTagNameNS(SVGNS, 'linearGradient')), 1,
|
self.assertEquals(len(f.getElementsByTagNameNS(SVGNS, 'linearGradient')), 1,
|
||||||
'Group in defs with id\'ed element removed');
|
'Group in defs with id\'ed element removed')
|
||||||
|
|
||||||
|
class AlwaysKeepClosePathSegments(unittest.TestCase):
|
||||||
|
def runTest(self):
|
||||||
|
p= scour.scourXmlFile('unittests/path-with-closepath.svg').getElementsByTagNameNS(SVGNS, 'path')[0]
|
||||||
|
self.assertEquals(p.getAttribute('d'), 'M10,10h100v100h-100z',
|
||||||
|
'Path with closepath not preserved')
|
||||||
|
|
||||||
# TODO: write tests for --set-precision for path data, for polygon data, for attributes
|
# TODO: write tests for --set-precision for path data, for polygon data, for attributes
|
||||||
# TODO; write a test for embedding rasters
|
# TODO; write a test for embedding rasters
|
||||||
|
|
|
||||||
11
unittests/important-groups-in-defs.svg
Normal file
11
unittests/important-groups-in-defs.svg
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<defs>
|
||||||
|
<g>
|
||||||
|
<linearGradient id="g1">
|
||||||
|
<stop offset="0" stop-color="blue"/>
|
||||||
|
<stop offset="1" stop-color="red"/>
|
||||||
|
</linearGradient>
|
||||||
|
</g>
|
||||||
|
</defs>
|
||||||
|
<rect fill="url(#g1)" width="100" height="100" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 249 B |
3
unittests/path-with-closepath.svg
Normal file
3
unittests/path-with-closepath.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill="none" stroke="#000" d="M10,10h100v100h-100z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 106 B |
Loading…
Add table
Add a link
Reference in a new issue