Skip to content

Commit 4c27d5d

Browse files
committed
Add test for issue #235
1 parent 89a6333 commit 4c27d5d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_parsing.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,3 +971,14 @@ def test_parse_error_issue_217_ignore(self):
971971
m = SVG.parse(block)
972972
q = list(m.elements())
973973
self.assertEqual(3, len(q))
974+
975+
976+
def test_dims_preservation_parsing_issue_235(self):
977+
q = io.StringIO(u'''<svg height="20mm" version="1.1" width="20mm" viewBox="10 10 20 20" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
978+
<rect x="10" y="10" width="20" height="20"/>
979+
</svg>''')
980+
parsed_svg = SVG.parse(q)
981+
expected_svg = SVG(width="20mm", height="20mm", viewBox="10 10 20 20")
982+
expected_svg.append(Rect(x=10, y=10, width=20, height=20))
983+
self.assertEqual(parsed_svg, expected_svg)
984+

0 commit comments

Comments
 (0)