Commit 7dc2796e authored by Romain Casati's avatar Romain Casati
Browse files

Testing PIL.

parent ef839a3a
iVBORw0KGgoAAAANSUhEUgAAAHgAAABaCAIAAAD8YgW4AAABD0lEQVR4nO3dwQnCQBBA0UTEFJL+S0oh68kKjET0C/G967Aw/MNeZx5jTHzf5dcL/AuhI0JHhI4IHRE6InRE6IjQkev+eFluzR7nMMb92ehF6Gmatu2ju5zXuu5NfR0RoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjsz79wxdrTjk/asVOy85xNcREToidEToiNARoSNCR4SOPACajxF7UXhV3wAAAABJRU5ErkJggg==
\ No newline at end of file
......@@ -17,8 +17,22 @@ def test_all(selenium):
def test_PIL(selenium):
#assert False
pass
result = selenium.run_basthon("""
from PIL import Image, ImageDraw
w, h = 120, 90
bbox = [(10, 10), (w - 10, h - 10)]
img = Image.new("RGB", (w, h), "#f9f9f9")
dctx = ImageDraw.Draw(img)
dctx.rectangle(bbox, fill="#ddddff", outline="blue")
img.show()
""")
assert result['stderr'] == ""
assert result['display']['display_type'] == 'multiple'
img = result['display']['content']['image/png']
with open(_test_data / "pil.png") as f:
target = f.read()
assert target == img
def test_matplotlib(selenium):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment