Skip to content

Commit

Permalink
Raise FileExists error if _original name suffix already exists before…
Browse files Browse the repository at this point in the history
… the test
  • Loading branch information
MaGering committed May 31, 2024
1 parent 874d8a5 commit 0417c98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_pipeline_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def test_raw_dir():
# Check if raw dir already exists
if os.path.isdir(absolute_path):
renamed_path = absolute_path + "_original"
if os.path.isdir(renamed_path):
raise FileExistsError(
f"The directory {renamed_path} already exists. \n"
f"The test can not be executed. Please rename the directory {renamed_path} first."
)
shutil.move(absolute_path, renamed_path)
else:
renamed_path = None
Expand Down

0 comments on commit 0417c98

Please sign in to comment.