make imports explicit

security-update
Andrew Port 2021-09-21 02:22:12 -07:00
parent da050a2eeb
commit d2b1ea5770
7 changed files with 18 additions and 18 deletions

View File

@ -1,7 +1,7 @@
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import numpy as np import numpy as np
import unittest import unittest
from svgpathtools.bezier import * from svgpathtools.bezier import bezier_point, bezier2polynomial, polynomial2bezier
from svgpathtools.path import bpoints2bezier from svgpathtools.path import bpoints2bezier

View File

@ -1,8 +1,7 @@
# Note: This file was taken mostly as is from the svg.path module (v 2.0) """credit: This was modified from a file in the svg.path module (v 2.0)"""
#------------------------------------------------------------------------------
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import unittest import unittest
from svgpathtools import * from svgpathtools import parse_path
class TestGeneration(unittest.TestCase): class TestGeneration(unittest.TestCase):

View File

@ -5,7 +5,7 @@ $ python -m unittest test.test_groups.TestGroups.test_group_flatten
""" """
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import unittest import unittest
from svgpathtools import * from svgpathtools import Document, SVG_NAMESPACE, parse_path
from os.path import join, dirname from os.path import join, dirname
import numpy as np import numpy as np

View File

@ -1,7 +1,7 @@
# Note: This file was taken mostly as is from the svg.path module (v 2.0) # Note: This file was taken mostly as is from the svg.path module (v 2.0)
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import unittest import unittest
from svgpathtools import * from svgpathtools import parse_path, Path, Line, QuadraticBezier, CubicBezier, Arc
import svgpathtools import svgpathtools
import numpy as np import numpy as np

View File

@ -4,7 +4,7 @@ import unittest
import numpy as np import numpy as np
# Internal dependencies # Internal dependencies
from svgpathtools import * from svgpathtools import rational_limit
class Test_polytools(unittest.TestCase): class Test_polytools(unittest.TestCase):

View File

@ -1,6 +1,6 @@
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import unittest import unittest
from svgpathtools import * from svgpathtools import SaxDocument
from os.path import join, dirname from os.path import join, dirname

View File

@ -1,8 +1,9 @@
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
import unittest import unittest
from svgpathtools import * from svgpathtools import svg2paths, Path, Line, Arc
from os.path import join, dirname from os.path import join, dirname
class TestSVG2Paths(unittest.TestCase): class TestSVG2Paths(unittest.TestCase):
def test_svg2paths_polygons(self): def test_svg2paths_polygons(self):
@ -15,8 +16,8 @@ class TestSVG2Paths(unittest.TestCase):
Line(105.5+50j, 55.5+0j) Line(105.5+50j, 55.5+0j)
) )
self.assertTrue(path.isclosed()) self.assertTrue(path.isclosed())
self.assertTrue(len(path)==3) self.assertEqual(len(path), 3)
self.assertTrue(path==path_correct) self.assertEqual(path, path_correct)
# triangular quadrilateral (with a redundant 4th "closure" point) # triangular quadrilateral (with a redundant 4th "closure" point)
path = paths[1] path = paths[1]
@ -26,8 +27,8 @@ class TestSVG2Paths(unittest.TestCase):
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())
self.assertTrue(len(path)==4) self.assertEqual(len(path), 4)
self.assertTrue(path==path_correct) self.assertEqual(path, path_correct)
def test_svg2paths_ellipses(self): def test_svg2paths_ellipses(self):
@ -37,8 +38,8 @@ class TestSVG2Paths(unittest.TestCase):
path_ellipse = paths[0] path_ellipse = paths[0]
path_ellipse_correct = Path(Arc(50+100j, 50+50j, 0.0, True, False, 150+100j), path_ellipse_correct = Path(Arc(50+100j, 50+50j, 0.0, True, False, 150+100j),
Arc(150+100j, 50+50j, 0.0, True, False, 50+100j)) Arc(150+100j, 50+50j, 0.0, True, False, 50+100j))
self.assertTrue(len(path_ellipse)==2) self.assertEqual(len(path_ellipse), 2)
self.assertTrue(path_ellipse==path_ellipse_correct) self.assertEqual(path_ellipse, path_ellipse_correct)
self.assertTrue(path_ellipse.isclosed()) self.assertTrue(path_ellipse.isclosed())
# circle tests # circle tests
@ -46,7 +47,7 @@ class TestSVG2Paths(unittest.TestCase):
path_circle = paths[0] path_circle = paths[0]
path_circle_correct = Path(Arc(50+100j, 50+50j, 0.0, True, False, 150+100j), path_circle_correct = Path(Arc(50+100j, 50+50j, 0.0, True, False, 150+100j),
Arc(150+100j, 50+50j, 0.0, True, False, 50+100j)) Arc(150+100j, 50+50j, 0.0, True, False, 50+100j))
self.assertTrue(len(path_circle)==2) self.assertEqual(len(path_circle), 2)
self.assertTrue(path_circle==path_circle_correct) self.assertEqual(path_circle, path_circle_correct)
self.assertTrue(path_circle.isclosed()) self.assertTrue(path_circle.isclosed())