Skip to content

Commit

Permalink
Reuse JAVA SDK models for testing (fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna-Shalamitskaya-EPAM committed Jul 4, 2024
1 parent 10a4af1 commit bac6099
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ def get_resources_folder_path() -> str:
return models_path


def clear_folder():
def clear_folder(resources_folder):
"""Remove all files to clear test models directory."""
resources_folder = get_resources_folder_path()

if exists(resources_folder) or len(listdir(resources_folder)) != 0:
if exists(resources_folder) and len(listdir(resources_folder)) != 0:
shutil.rmtree(resources_folder)

mkdir(resources_folder)
Expand Down Expand Up @@ -66,7 +64,7 @@ def download_test_models(version: str = Const.JAVA_CLI_VERSION):
jar_file_path = join(resources_folder, jar_file_name)

print(f"Remove previous version of test models from the folder {resources_folder}")
clear_folder()
clear_folder(resources_folder)

print(f"Start downloading esmf-test-aspect-models version {version}")
download_jar_file(jar_file_path)
Expand Down

0 comments on commit bac6099

Please sign in to comment.