diff --git a/test/test_svg2paths.py b/test/test_svg2paths.py index b5cf5b4..06220bb 100644 --- a/test/test_svg2paths.py +++ b/test/test_svg2paths.py @@ -74,7 +74,7 @@ class TestSVG2Paths(unittest.TestCase): self.assertEqual(len(paths), 2) def test_from_stringio(self): - """ Test reading svg object contained in an StringIO object """ + """ Test reading svg object contained in a StringIO object """ with open(join(dirname(__file__), 'polygons.svg'), 'r') as file: # read entire file into string file_content: str = file.read() @@ -88,3 +88,23 @@ class TestSVG2Paths(unittest.TestCase): paths, _ = svg2paths(file_as_stringio) self.assertEqual(len(paths), 2) + + def test_from_string_without_svg_attrs(self): + """ Test reading svg object contained in a string without svg attributes""" + with open(join(dirname(__file__), 'polygons.svg'), 'r') as file: + # read entire file into string + file_content: str = file.read() + + 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') as file: + # read entire file into string + file_content: str = file.read() + + paths, _, _ = svg_string2paths2(file_content) + + self.assertEqual(len(paths), 2)