def test_diagonal_line_length(self): pathdata = 'M0 0 L1 1' diagonal_line = SvgPath(pathdata=pathdata) pathlength = diagonal_line.length() expected_pathlength = np.sqrt(2.) self.assertAlmostEqual(pathlength, expected_pathlength, places=8)
def test_line_length(self): pathdata = 'M0 0 H3' horizontal_line = SvgPath(pathdata=pathdata) pathlength = horizontal_line.length() expected_pathlength = 3. self.assertAlmostEqual(pathlength, expected_pathlength, places=8)