Merge c42dc6b793 into 47f918e696
This commit is contained in:
commit
18f3cbd193
2 changed files with 56 additions and 35 deletions
11
testscour.py
11
testscour.py
|
|
@ -2387,7 +2387,7 @@ class DoNotStripXmlSpaceAttribute(unittest.TestCase):
|
|||
|
||||
class CommandLineUsage(unittest.TestCase):
|
||||
|
||||
USAGE_STRING = "Usage: scour [INPUT.SVG [OUTPUT.SVG]] [OPTIONS]"
|
||||
USAGE_STRING = "Usage: scour [INPUT.SVG [[... INPUT.SVG] OUTPUT]] [OPTIONS]"
|
||||
MINIMAL_SVG = '<?xml version="1.0" encoding="UTF-8"?>\n' \
|
||||
'<svg xmlns="http://www.w3.org/2000/svg"/>\n'
|
||||
TEMP_SVG_FILE = 'testscour_temp.svg'
|
||||
|
|
@ -2555,12 +2555,13 @@ class EmbedRasters(unittest.TestCase):
|
|||
|
||||
def test_disable_embed_rasters(self):
|
||||
doc = scourXmlFile('unittests/raster-formats.svg',
|
||||
parse_args(['--disable-embed-rasters']))
|
||||
parse_args(['--disable-embed-rasters']),
|
||||
'unittests')
|
||||
self.assertEqual(doc.getElementById('png').getAttribute('xlink:href'), 'raster.png',
|
||||
"Raster image embedded when '--disable-embed-rasters' was specified")
|
||||
|
||||
def test_raster_formats(self):
|
||||
doc = scourXmlFile('unittests/raster-formats.svg')
|
||||
doc = scourXmlFile('unittests/raster-formats.svg', None, 'unittests')
|
||||
self.assertEqual(doc.getElementById('png').getAttribute('xlink:href'),
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAABAgMAAABmjvwnAAAAC'
|
||||
'VBMVEUAAP//AAAA/wBmtfVOAAAACklEQVQI12NIAAAAYgBhGxZhsAAAAABJRU5ErkJggg==',
|
||||
|
|
@ -2578,7 +2579,7 @@ class EmbedRasters(unittest.TestCase):
|
|||
"Raster image (JPG) not correctly embedded.")
|
||||
|
||||
def test_raster_paths_local(self):
|
||||
doc = scourXmlFile('unittests/raster-paths-local.svg')
|
||||
doc = scourXmlFile('unittests/raster-paths-local.svg', None, 'unittests')
|
||||
images = doc.getElementsByTagName('image')
|
||||
for image in images:
|
||||
href = image.getAttribute('xlink:href')
|
||||
|
|
@ -2592,7 +2593,7 @@ class EmbedRasters(unittest.TestCase):
|
|||
# create a reference string by scouring the original file with relative links
|
||||
options = ScourOptions
|
||||
options.infilename = 'unittests/raster-formats.svg'
|
||||
reference_svg = scourString(svg, options)
|
||||
reference_svg = scourString(svg, options, 'unittests')
|
||||
|
||||
# this will not always create formally valid paths but it'll check how robust our implementation is
|
||||
# (the third path is invalid for sure because file: needs three slashes according to URI spec)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue