Fix Issue 479669: Handle empty styl elements

This commit is contained in:
JSCHILL1 2009-11-09 21:27:26 -06:00
parent 99dfb0f819
commit 7e8d777639
3 changed files with 20 additions and 6 deletions

View file

@ -957,6 +957,16 @@ class EnsurePreserveWhitespaceOnNonTextElements(unittest.TestCase):
self.assertEquals( s.count('\n'), 5,
'Did not properly preserve whitespace on elements even if they were not textual')
class HandleEmptyStyleElement(unittest.TestCase):
def runTest(self):
try:
styles = scour.scourXmlFile('unittests/empty-style.svg').getElementsByTagNameNS(SVGNS, 'style')
fail = len(styles) != 1
except AttributeError:
fail = True
self.assertEquals( fail, False,
'Could not handle an empty style element')
# TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters
# TODO: write tests for --keep-editor-data