Skip to content

Commit f20eeca

Browse files
fix: Tests
1 parent 9c098bd commit f20eeca

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies = [
2828
"scooby>=0.5.12",
2929
"appdirs>=1.4.4",
3030
"typing-extensions>=4.5.0",
31+
"requests>=2.32.4",
3132
]
3233

3334
[project.optional-dependencies]

tests/test_example_download.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from pathlib import Path
2525

2626
import pytest
27+
import requests
2728

2829
from ansys.tools.common.example_download import download_manager
2930

@@ -34,14 +35,14 @@ def test_download():
3435
directory = "pymapdl/cfx_mapping"
3536

3637
# Download the file
37-
local_path = download_manager.download_file(filename, directory)
38-
39-
assert Path.is_file(local_path)
38+
local_path_str = download_manager.download_file(filename, directory)
39+
local_path = Path(local_path_str)
40+
assert local_path.is_file()
4041

4142
# Check that file is cached
4243
local_path2 = download_manager.download_file(filename, directory)
4344

44-
assert local_path2 == local_path
45+
assert local_path2 == local_path_str
4546

4647
download_manager.clear_download_cache()
4748

@@ -54,7 +55,7 @@ def test_non_existent_file():
5455
directory = "pymapdl/cfx_mapping"
5556

5657
# Attempt to download the non-existent file
57-
with pytest.raises(FileNotFoundError):
58+
with pytest.raises(requests.exceptions.HTTPError):
5859
download_manager.download_file(filename, directory)
5960

6061

0 commit comments

Comments
 (0)