~bryce/scour/dual-license

« back to all changes in this revision

Viewing changes to testscour.py

  • Committer: Louis Simard
  • Author(s): Hungerburg
  • Date: 2011-08-26 02:26:05 UTC
  • Revision ID: cynthia@jolteon-20110826022605-yo9wy7qjymdtt3ht
Apply a modified patch by Hungerburg to fix bugs 833666, "scour does not clean comments if file starts with a comment", and bug 804238, whereby Scour fails to correctly parse a polygon/polyline if its first coordinate is negative.

Unit tests added for the negative coordinate parsing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
                self.assertEquals(p.getAttribute('points'), '100 -100 100 -100 100 -100 -100 -100 -100 200',
705
705
                        'Negative polyline coordinates not properly parsed')
706
706
 
 
707
class ScourPolygonNegativeCoordFirst(unittest.TestCase):
 
708
        def runTest(self):
 
709
                p = scour.scourXmlFile('unittests/polygon-coord-neg-first.svg').getElementsByTagNameNS(SVGNS, 'polygon')[0]
 
710
                #  points="-100,-100,100-100,100-100-100,-100-100,200" />
 
711
                self.assertEquals(p.getAttribute('points'), '-100 -100 100 -100 100 -100 -100 -100 -100 200',
 
712
                        'Negative polygon coordinates not properly parsed')
 
713
 
 
714
class ScourPolylineNegativeCoordFirst(unittest.TestCase):
 
715
        def runTest(self):
 
716
                p = scour.scourXmlFile('unittests/polyline-coord-neg-first.svg').getElementsByTagNameNS(SVGNS, 'polyline')[0]
 
717
                self.assertEquals(p.getAttribute('points'), '-100 -100 100 -100 100 -100 -100 -100 -100 200',
 
718
                        'Negative polyline coordinates not properly parsed')
 
719
 
707
720
class DoNotRemoveGroupsWithIDsInDefs(unittest.TestCase):
708
721
        def runTest(self):
709
722
                f = scour.scourXmlFile('unittests/important-groups-in-defs.svg')