def test_rel_line_to(): pt = PathCanvas() pt.translate(1000, 2000) pt.move_to(0, 0) pt.rel_line_to(100, 200) assert pt.paths == [ Path([Point(1000.0, 2000.0), Point(1100.0, 2200.0)]), ]
def test_two_segments(): pt = PathCanvas() pt.move_to(100, 100) pt.line_to(150, 200) pt.move_to(17, 17) pt.rel_line_to(100, 200) pt.close_path() assert pt.paths == [ Path([Point(100.0, 100.0), Point(150.0, 200.0)]), Path([Point(17.0, 17.0), Point(117.0, 217.0), Point(17.0, 17.0)]), ]