Ejemplo n.º 1
0
def test_display():
    with NamedTemporaryFile(suffix='.png', delete=True) as temp:
        fname = temp.name
        device = capture(file_template=fname, transform="none")

        # Use the same drawing primitives as the demo
        with canvas(device) as draw:
            baseline_data.primitives(device, draw)

        assert_identical('capture.png', fname)
Ejemplo n.º 2
0
def test_gifanim_write():
    with NamedTemporaryFile(suffix='.gif') as temp:
        fname = temp.name
        device = gifanim(filename=fname)

        with canvas(device) as draw:
            baseline_data.primitives(device, draw)

        with canvas(device) as draw:
            draw.text((30, 10), text="Blipvert", fill="white")

        with canvas(device) as draw:
            baseline_data.primitives(device, draw)

        device.write_animation()
        assert_identical('anim.gif', fname)