Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Kernel
Commits
7dc2796e
Commit
7dc2796e
authored
Jan 31, 2021
by
Romain Casati
Browse files
Testing PIL.
parent
ef839a3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/data/pil.png
0 → 100644
View file @
7dc2796e
iVBORw0KGgoAAAANSUhEUgAAAHgAAABaCAIAAAD8YgW4AAABD0lEQVR4nO3dwQnCQBBA0UTEFJL+S0oh68kKjET0C/G967Aw/MNeZx5jTHzf5dcL/AuhI0JHhI4IHRE6InRE6IjQkev+eFluzR7nMMb92ehF6Gmatu2ju5zXuu5NfR0RoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjsz79wxdrTjk/asVOy85xNcREToidEToiNARoSNCR4SOPACajxF7UXhV3wAAAABJRU5ErkJggg==
\ No newline at end of file
tests/test_hack_modules.py
View file @
7dc2796e
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment