From aacd5fa96d57676d2e7a5ee35215cc9e082e5d08 Mon Sep 17 00:00:00 2001 From: FlyingSamson Date: Wed, 25 May 2022 17:45:31 +0200 Subject: [PATCH] Remove second version of function returning the svg_attributes by default --- svgpathtools/svg_to_paths.py | 21 --------------------- test/test_svg2paths.py | 15 ++------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/svgpathtools/svg_to_paths.py b/svgpathtools/svg_to_paths.py index 98d2b1d..d8c9a4b 100644 --- a/svgpathtools/svg_to_paths.py +++ b/svgpathtools/svg_to_paths.py @@ -279,24 +279,3 @@ def svg_string2paths(svg_string, convert_polylines_to_paths=convert_polylines_to_paths, convert_polygons_to_paths=convert_polygons_to_paths, convert_rectangles_to_paths=convert_rectangles_to_paths) - - -def svg_string2paths2(svg_string, - return_svg_attributes=True, - convert_circles_to_paths=True, - convert_ellipses_to_paths=True, - convert_lines_to_paths=True, - convert_polylines_to_paths=True, - convert_polygons_to_paths=True, - convert_rectangles_to_paths=True): - """Convenience function; identical to svg2paths2() except that it takes the - svg object as string. See svg2paths() docstring for more - info.""" - return svg_string2paths(svg_string=svg_string, - return_svg_attributes=return_svg_attributes, - convert_circles_to_paths=convert_circles_to_paths, - convert_ellipses_to_paths=convert_ellipses_to_paths, - convert_lines_to_paths=convert_lines_to_paths, - convert_polylines_to_paths=convert_polylines_to_paths, - convert_polygons_to_paths=convert_polygons_to_paths, - convert_rectangles_to_paths=convert_rectangles_to_paths) diff --git a/test/test_svg2paths.py b/test/test_svg2paths.py index 4533cc9..faeccc1 100644 --- a/test/test_svg2paths.py +++ b/test/test_svg2paths.py @@ -87,8 +87,8 @@ class TestSVG2Paths(unittest.TestCase): self.assertEqual(len(paths), 2) - def test_from_string_without_svg_attrs(self): - """ Test reading svg object contained in a string without svg attributes""" + def test_from_string(self): + """ Test reading svg object contained in a string """ with open(join(dirname(__file__), 'polygons.svg'), 'r', encoding='utf-8') as file: # read entire file into string @@ -97,14 +97,3 @@ class TestSVG2Paths(unittest.TestCase): paths, _ = svg_string2paths(file_content) self.assertEqual(len(paths), 2) - - def test_from_string_with_svg_attrs(self): - """ Test reading svg object contained in a string with svg attributes""" - with open(join(dirname(__file__), 'polygons.svg'), - 'r', encoding='utf-8') as file: - # read entire file into string - file_content = file.read() - - paths, _, _ = svg_string2paths2(file_content) - - self.assertEqual(len(paths), 2)