1
0
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:
Tomas Susanka 2020-01-09 14:32:11 +00:00
parent 346e1e3ebc
commit b99a6d5f6c

View File

@ -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))