Пример #1
0
 def test_howto_example_drawing_line(self):
     """tests the fifth canvas example from howto"""
     test_image = get_image("canvas_5.png")
     o = get_mock_output()
     c = Canvas(o, name=c_name)
     c.circle(("-8", 8, 4))
     assert(imgs_are_equal(c.get_image(), test_image))
Пример #2
0
def get_yes_icon(width=40, height=40):
    o = MockOutput(width, height)
    c = Canvas(o)
    cx, cy = c.get_center()
    c.circle((cx, cy, min(width / 2, height / 2) - 1), fill="white")
    c.line((cx - 15, cy, cx, cy + 15), fill="black", width=5)
    c.line((cx - 1, cy + 15, cx + 10, cy - 12), fill="black", width=4)
    return c.get_image()