Add test case for #203

Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
Niels Thykier 2018-08-18 16:27:33 +00:00 committed by Patrick Storz
parent 09a656287d
commit f61b4d36d6
2 changed files with 31 additions and 0 deletions

View file

@ -1401,6 +1401,20 @@ class RemoveDuplicateRadialGradients(unittest.TestCase):
'Duplicate radial gradient not removed')
class RemoveDuplicateRadialGradientsEnsureMasterHasID(unittest.TestCase):
def runTest(self):
svgdoc = scourXmlFile('unittests/remove-duplicate-gradients-master-without-id.svg')
lingrads = svgdoc.getElementsByTagNameNS(SVGNS, 'linearGradient')
rect = svgdoc.getElementById('r1')
self.assertEqual(1, lingrads.length,
'Duplicate linearGradient not removed')
self.assertEqual(lingrads[0].getAttribute("id"), "g1",
"linearGradient has a proper ID")
self.assertNotEqual(rect.getAttribute("fill"), "url(#)",
"linearGradient has a proper ID")
class RereferenceForRadialGradient(unittest.TestCase):
def runTest(self):