polygon/polyline parsing tests added

pull/56/head
Dmitry_Milk 2018-05-27 12:34:12 +03:00
parent 2dcfa88cf2
commit 321e097a4e
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<svg baseProfile="full" height="600px" version="1.1" viewBox="-10.05 -10.05 120.1 120.1" width="600px" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg baseProfile="full" height="600px" version="1.1" viewBox="-10.05 -10.05 120.1 120.1" width="600px" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
<polygon points="55.5,0 55.5, 50 105.5,50" style="stroke:purple;stroke-width:1"/> <polygon points="55.5,0 55.5, 50 105.5,50" style="stroke:purple;stroke-width:1"/>
<polygon points="0,0 0,100 100,100 0,0" style="stroke:purple;stroke-width:1"/> <polygon points="0,0.0 0,-100 , 1.0e-1-1e2,0,0" style="stroke:purple;stroke-width:1"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 431 B

View File

@ -20,9 +20,9 @@ class TestSVG2Paths(unittest.TestCase):
# triangular quadrilateral (with a redundant 4th "closure" point) # triangular quadrilateral (with a redundant 4th "closure" point)
path = paths[1] path = paths[1]
path_correct = Path(Line(0+0j, 0+100j), path_correct = Path(Line(0+0j, 0-100j),
Line(0+100j, 100+100j), Line(0-100j, 0.1-100j),
Line(100+100j, 0+0j), Line(0.1-100j, 0+0j),
Line(0+0j, 0+0j) # result of redundant point Line(0+0j, 0+0j) # result of redundant point
) )
self.assertTrue(path.isclosed()) self.assertTrue(path.isclosed())