Skip to content

Commit

Permalink
Read backup file in test
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Mar 13, 2024
1 parent 6894770 commit f73725c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_impls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ def test_edit_git_commit(commit_file_type, initial_contents, expected_contents):
with _edit_git_commit(config):
with open(commit_file) as f:
assert f.read() == expected_contents
assert os.path.exists(
os.path.join(d, ".commit-file.rapids-build-backend.bak")
) == (initial_contents is not None)
bkp_file = os.path.join(d, ".commit-file.rapids-build-backend.bak")
if initial_contents is not None:
with open(bkp_file) as f:
assert f.read() == initial_contents
else:
assert not os.path.exists(bkp_file)

if initial_contents is not None:
with open(commit_file) as f:
Expand Down

0 comments on commit f73725c

Please sign in to comment.