minor fix to docstring formatting

support-stringio-objects
Andrew Port 2022-06-05 21:49:21 -07:00
parent e8792f4d2d
commit b82530aaac
1 changed files with 5 additions and 5 deletions

View File

@ -64,13 +64,13 @@ class TestSVG2Paths(unittest.TestCase):
self.assertEqual(rect2pathd(rounded), "M 25.0 10.0 L 95.0 10.0 A 15.0 12.0 0 0 1 110.0 22.0 L 110.0 98.0 A 15.0 12.0 0 0 1 95.0 110.0 L 25.0 110.0 A 15.0 12.0 0 0 1 10.0 98.0 L 10.0 22.0 A 15.0 12.0 0 0 1 25.0 10.0 z") self.assertEqual(rect2pathd(rounded), "M 25.0 10.0 L 95.0 10.0 A 15.0 12.0 0 0 1 110.0 22.0 L 110.0 98.0 A 15.0 12.0 0 0 1 95.0 110.0 L 25.0 110.0 A 15.0 12.0 0 0 1 10.0 98.0 L 10.0 22.0 A 15.0 12.0 0 0 1 25.0 10.0 z")
def test_from_file_path_string(self): def test_from_file_path_string(self):
""" Test reading svg from file provided as path""" """Test reading svg from file provided as path"""
paths, _ = svg2paths(join(dirname(__file__), 'polygons.svg')) paths, _ = svg2paths(join(dirname(__file__), 'polygons.svg'))
self.assertEqual(len(paths), 2) self.assertEqual(len(paths), 2)
def test_from_file_path(self): def test_from_file_path(self):
""" Test reading svg from file provided as pathlib POSIXPath""" """Test reading svg from file provided as pathlib POSIXPath"""
if version_info >= (3, 6): if version_info >= (3, 6):
import pathlib import pathlib
paths, _ = svg2paths(pathlib.Path(__file__).parent / 'polygons.svg') paths, _ = svg2paths(pathlib.Path(__file__).parent / 'polygons.svg')
@ -78,14 +78,14 @@ class TestSVG2Paths(unittest.TestCase):
self.assertEqual(len(paths), 2) self.assertEqual(len(paths), 2)
def test_from_file_object(self): def test_from_file_object(self):
""" Test reading svg from file object that has already been opened """ """Test reading svg from file object that has already been opened"""
with open(join(dirname(__file__), 'polygons.svg'), 'r') as file: with open(join(dirname(__file__), 'polygons.svg'), 'r') as file:
paths, _ = svg2paths(file) paths, _ = svg2paths(file)
self.assertEqual(len(paths), 2) self.assertEqual(len(paths), 2)
def test_from_stringio(self): def test_from_stringio(self):
""" Test reading svg object contained in a StringIO object """ """Test reading svg object contained in a StringIO object"""
with open(join(dirname(__file__), 'polygons.svg'), with open(join(dirname(__file__), 'polygons.svg'),
'r', encoding='utf-8') as file: 'r', encoding='utf-8') as file:
# read entire file into string # read entire file into string
@ -98,7 +98,7 @@ class TestSVG2Paths(unittest.TestCase):
self.assertEqual(len(paths), 2) self.assertEqual(len(paths), 2)
def test_from_string(self): def test_from_string(self):
""" Test reading svg object contained in a string """ """Test reading svg object contained in a string"""
with open(join(dirname(__file__), 'polygons.svg'), with open(join(dirname(__file__), 'polygons.svg'),
'r', encoding='utf-8') as file: 'r', encoding='utf-8') as file:
# read entire file into string # read entire file into string