Fix Bug 411062: typo of 'true'. Modify unit test to cover exercising the code. Update testscour.py for new indent_type option.

This commit is contained in:
JSCHILL1 2009-08-09 15:04:50 -05:00
parent e17d3b8526
commit 5f5c8a431d
3 changed files with 8 additions and 3 deletions

View file

@ -30,7 +30,8 @@
# * Collapse all group based transformations
# Even more ideas here: http://esw.w3.org/topic/SvgTidy
# * analysis of path elements to see if rect can be used instead?
# * analysis of path elements to see if rect can be used instead? (must also need to look
# at rounded corners)
# * removal of unused attributes in groups:
# <g fill="blue" ...>
# <rect fill="red" ... />
@ -1866,7 +1867,7 @@ def remapNamespacePrefix(node, oldprefix, newprefix):
# clone and add all the child nodes
for child in node.childNodes:
newNode.appendChild(child.cloneNode(true))
newNode.appendChild(child.cloneNode(True))
# replace old node with new node
node = parent.replaceChild( newNode, node )

View file

@ -46,6 +46,7 @@ class ScourOptions:
embed_rasters = True
keep_editor_data = False
strip_xml_prolog = False
indent_type = "space"
class NoInkscapeElements(unittest.TestCase):
def runTest(self):
@ -754,6 +755,7 @@ class RemoveRedundantSvgNamespacePrefix(unittest.TestCase):
self.assertEquals( r.tagName, 'rect',
'Redundant svg: prefix not removed')
class RemoveDefaultGradX1Value(unittest.TestCase):
def runTest(self):
g = scour.scourXmlFile('unittests/gradient-default-attrs.svg').getElementsByTagNameNS(SVGNS, 'linearGradient')[0]

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:vector="http://www.w3.org/2000/svg">
<rect height="300" width="300"/>
<svg:rect height="200" width="200"/>
<svg:rect height="200" width="200">
<title>Test</title>
</svg:rect>
<vector:rect height="100" width="100"/>
</svg>

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 330 B

Before After
Before After