def test_draw_comment(): comment = 'pikachu\'s ghost' expected = '#pikachu\'s ghost\n' with nested(Image(width=1, height=1), Drawing()) as (img, draw): draw.comment(comment) draw(img) blob = img.make_blob(format="mvg") assert expected == text(blob)
def test_new_from_unicode_filename(fx_asset, tmpdir): """https://github.com/dahlia/wand/issues/122""" filename = '모나리자.jpg' if not PY3: filename = filename.decode('utf-8') path = os.path.join(text_type(tmpdir), filename) # workaround py.path bug shutil.copyfile(str(fx_asset.join('mona-lisa.jpg')), path) with Image(filename=text(path)) as img: assert img.width == 402
def test_draw_comment(): comment = 'pikachu\'s ghost' expected = '#pikachu\'s ghost\n' with Image(width=1, height=1) as img: with Drawing() as draw: draw.comment(comment) draw(img) try: blob = img.make_blob(format="mvg") except PolicyError as pe: skip("MVG disabled by security polcies.") else: assert expected == text(blob)
def test_draw_comment(): skip('TODO - Rewrite as MVG is now disabled by default on CI runner.') comment = 'pikachu\'s ghost' expected = '#pikachu\'s ghost\n' with Image(width=1, height=1) as img: with Drawing() as draw: draw.comment(comment) draw(img) try: blob = img.make_blob(format="mvg") except PolicyError as pe: skip('MVG disabled by security policies. ' + repr(pe)) else: assert expected == text(blob)