import cairo from gaphas.painter.freehand import FreeHandCairoContext def test_drawing_lines(): surface = cairo.SVGSurface("freehand-drawing-lines.svg", 100, 100) cr = FreeHandCairoContext(cairo.Context(surface)) cr.set_line_width(2) cr.move_to(20, 20) cr.line_to(20, 80) cr.line_to(80, 80) cr.line_to(80, 20) cr.stroke() cr.show_page() def test_drawing_rectangle(): surface = cairo.SVGSurface("freehand-drawing-rectangle.svg", 100, 100) cr = FreeHandCairoContext(cairo.Context(surface)) cr.set_line_width(2) cr.rectangle(20, 20, 60, 60) cr.stroke() cr.show_page() DRAWING_LINES_OUTPUT = """ """