Unittests for --enable-viewboxing
This commit is contained in:
parent
512bcc1737
commit
7521c5c283
3 changed files with 21 additions and 1 deletions
16
testscour.py
16
testscour.py
|
|
@ -2505,7 +2505,21 @@ class EmbedRasters(unittest.TestCase):
|
|||
"Raster image from remote path '" + href + "' not embedded.")
|
||||
|
||||
|
||||
# TODO: write tests for --enable-viewboxing
|
||||
class ViewBox(unittest.TestCase):
|
||||
|
||||
def test_viewbox_create(self):
|
||||
doc = scourXmlFile('unittests/viewbox-create.svg', parse_args(['--enable-viewboxing']))
|
||||
viewBox = doc.documentElement.getAttribute('viewBox')
|
||||
self.assertEqual(viewBox, '0 0 123.46 654.32', "viewBox not properly created with '--enable-viewboxing'.")
|
||||
|
||||
def test_viewbox_remove_width_and_height(self):
|
||||
doc = scourXmlFile('unittests/viewbox-remove.svg', parse_args(['--enable-viewboxing']))
|
||||
width = doc.documentElement.getAttribute('width')
|
||||
height = doc.documentElement.getAttribute('height')
|
||||
self.assertEqual(width, '', "width not removed with '--enable-viewboxing'.")
|
||||
self.assertEqual(height, '', "height not removed with '--enable-viewboxing'.")
|
||||
|
||||
|
||||
# TODO: write tests for --keep-editor-data
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
3
unittests/viewbox-create.svg
Normal file
3
unittests/viewbox-create.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="123.456" height="654.321">
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 120 B |
3
unittests/viewbox-remove.svg
Normal file
3
unittests/viewbox-remove.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="123.456" height="654.321" viewBox="0 0 123.456 654.321">
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 150 B |
Loading…
Add table
Add a link
Reference in a new issue