Skip to content

Commit

Permalink
Make sure info.png is deleted and regenerated only in test_basic.py
Browse files Browse the repository at this point in the history
info.png is deleted on unrelated golden snapshot generations.
  • Loading branch information
ajinkyaraj-23 committed Jul 17, 2024
1 parent 469276a commit 52d748e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/integration/touch/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
if __name__ == "__main__":
app = tezos_app(__file__)

app.remove_info_page()
app.assert_home()

app.welcome.settings()
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/touch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52d748e

Please sign in to comment.