def test_reverse_path(operations, expected): path = Path() for verb, pts in operations: path.add(verb, *pts) path.reverse() assert list(path) == expected
def test_intersection(subject_path, clip_path, expected): sub = Path() for verb, pts in subject_path: sub.add(verb, *pts) clip = Path() for verb, pts in clip_path: clip.add(verb, *pts) result = Path() intersection([sub], [clip], result.getPen()) assert list(result) == expected