mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-06 06:42:33 +00:00
tests/ui: refactor image reading
This commit is contained in:
parent
346e1e3ebc
commit
b99a6d5f6c
@ -18,9 +18,9 @@ def _image(src):
|
|||||||
with td():
|
with td():
|
||||||
if src:
|
if src:
|
||||||
# open image file
|
# open image file
|
||||||
image = open(src, "rb")
|
image = src.read_bytes()
|
||||||
# encode image as base64
|
# encode image as base64
|
||||||
image = base64.b64encode(image.read())
|
image = base64.b64encode(image)
|
||||||
# convert output to str
|
# convert output to str
|
||||||
image = image.decode()
|
image = image.decode()
|
||||||
# img(src=src.relative_to(fixture_test_path))
|
# img(src=src.relative_to(fixture_test_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user