tests: Add unit tests for preservation of quotes in CSS styles

These tests will ensure that issues #21 and #56 do not return.
This commit is contained in:
Michael Witten 2017-08-27 02:16:31 +00:00
parent 7739f058c3
commit 908fe9df34
2 changed files with 16 additions and 0 deletions

View file

@ -1818,6 +1818,17 @@ class HandleQuotesInAttributes(unittest.TestCase):
'Failed on attribute value with the same number of double quotes as single quotes')
class PreserveQuotesInStyles(unittest.TestCase):
def runTest(self):
with open('unittests/quotes-in-styles.svg', "rb") as f:
output = scourString(f.read())
self.assertTrue('use[id="t"]' in output,
'Failed to preserve quote characters in a style element')
self.assertTrue("'Times New Roman'" in output,
'Failed to preserve quote characters in a style attribute')
class DoNotStripCommentsOutsideOfRoot(unittest.TestCase):
def runTest(self):