1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

tests/ui: rename also tested fixtures

This commit is contained in:
Tomas Susanka 2019-12-29 19:21:05 +00:00
parent 3a035a0ef8
commit 2ceeacb5db

View File

@ -81,9 +81,12 @@ def _process_recorded(screen_path):
digest = _hash_files(records) digest = _hash_files(records)
with open(screen_path / "../hash.txt", "w") as f: with open(screen_path / "../hash.txt", "w") as f:
f.write(digest) f.write(digest)
_rename_records(screen_path)
def _rename_records(screen_path):
# rename screenshots # rename screenshots
for index, record in enumerate(sorted(records)): for index, record in enumerate(sorted(screen_path.iterdir())):
filename = screen_path / "{:08}.png".format(index) filename = screen_path / "{:08}.png".format(index)
record.replace(filename) record.replace(filename)
@ -107,6 +110,8 @@ def _process_tested(screen_path, test_name):
with open(hash_file, "r") as f: with open(hash_file, "r") as f:
expected_hash = f.read() expected_hash = f.read()
_rename_records(screen_path)
records = sorted(screen_path.iterdir()) records = sorted(screen_path.iterdir())
actual_hash = _hash_files(records) actual_hash = _hash_files(records)