1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-12 16:30:56 +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():
if src:
# open image file
image = open(src, "rb")
image = src.read_bytes()
# encode image as base64
image = base64.b64encode(image.read())
image = base64.b64encode(image)
# convert output to str
image = image.decode()
# img(src=src.relative_to(fixture_test_path))