mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
tests/ui: fix deploy script
This commit is contained in:
parent
4baa76dc67
commit
30684bc46b
@ -1,4 +1,5 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
|
import json
|
||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@ -12,10 +13,15 @@ def _hash_files(path):
|
|||||||
return hasher.digest().hex()
|
return hasher.digest().hex()
|
||||||
|
|
||||||
|
|
||||||
fixture_root = Path().cwd() / "../tests/ui_tests/fixtures/"
|
root = Path().cwd() / "../tests/ui_tests"
|
||||||
|
screens = root / "screens"
|
||||||
|
fixtures = root / "fixtures.json"
|
||||||
|
|
||||||
for recorded_dir in fixture_root.glob("*/recorded"):
|
hashes = json.loads(fixtures.read_text())
|
||||||
expected_hash = (recorded_dir.parent / "hash.txt").read_text()
|
|
||||||
|
for test_case in hashes.keys():
|
||||||
|
recorded_dir = screens / test_case / "recorded"
|
||||||
|
expected_hash = hashes[test_case]
|
||||||
actual_hash = _hash_files(recorded_dir)
|
actual_hash = _hash_files(recorded_dir)
|
||||||
assert expected_hash == actual_hash
|
assert expected_hash == actual_hash
|
||||||
shutil.make_archive("ui_test_records/" + actual_hash, "zip", recorded_dir)
|
shutil.make_archive("ui_test_records/" + actual_hash, "zip", recorded_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user