From 52d748e2a4b9c3a397adf6c12ba4e5f67a56ac06 Mon Sep 17 00:00:00 2001 From: Ajinkya Rajandekar <145996984+ajinkyaraj-23@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:03:09 +0100 Subject: [PATCH] Make sure info.png is deleted and regenerated only in test_basic.py info.png is deleted on unrelated golden snapshot generations. --- tests/integration/touch/test_basic.py | 1 + tests/integration/touch/utils.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/integration/touch/test_basic.py b/tests/integration/touch/test_basic.py index d1edf3be5..6e4a82a5d 100755 --- a/tests/integration/touch/test_basic.py +++ b/tests/integration/touch/test_basic.py @@ -19,6 +19,7 @@ if __name__ == "__main__": app = tezos_app(__file__) + app.remove_info_page() app.assert_home() app.welcome.settings() diff --git a/tests/integration/touch/utils.py b/tests/integration/touch/utils.py index a8ffa05c5..ae7756fba 100644 --- a/tests/integration/touch/utils.py +++ b/tests/integration/touch/utils.py @@ -224,14 +224,18 @@ def __init__(self, os.remove(os.path.join(path, filename)) path = f"{self.__snapshots_path}" home_path=os.path.join(path, "home.png") - info_path=os.path.join(path, "info.png") if os.path.exists(home_path): os.remove(home_path) - if os.path.exists(info_path): os.remove(info_path) def send_apdu(self, data): """Send hex-encoded bytes to the apdu""" self.__backend.send_raw(bytes.fromhex(data)) + def remove_info_page(self): + """ Delete the info page for golden tests""" + if self.__golden: + info_path=os.path.join(self.__snapshots_path, "info.png") + if os.path.exists(info_path): os.remove(info_path) + def expect_apdu_return(self, expected): """Expect hex-encoded response from the apdu""" response = self.__backend.receive().raw