Skip to content

Commit e1d0ffb

Browse files
test: Latest changes
1 parent 58c5567 commit e1d0ffb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_example_download.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,28 @@ def test_non_existent_file():
5151
# Attempt to download the non-existent file
5252
with pytest.raises(FileNotFoundError):
5353
download_manager.download_file(filename, directory)
54+
55+
56+
def test_get_filepath():
57+
"""Test getting the file path of a downloaded file."""
58+
filename = "11_blades_mode_1_ND_0.csv"
59+
directory = "pymapdl/cfx_mapping"
60+
61+
# Get the file path
62+
filepath = download_manager._get_filepath_on_default_server(filename, directory)
63+
64+
assert filepath == "https://github.com/ansys/example-data/raw/main/pymapdl/cfx_mapping/11_blades_mode_1_ND_0.csv"
65+
66+
directory += "/"
67+
filepath = download_manager._get_filepath_on_default_server(filename, directory)
68+
69+
assert filepath == "https://github.com/ansys/example-data/raw/main/pymapdl/cfx_mapping/11_blades_mode_1_ND_0.csv"
70+
71+
72+
def test_destination_directory():
73+
"""Test getting the destination directory for a downloaded file."""
74+
filename = "11_blades_mode_1_ND_0.csv"
75+
directory = "pymapdl/cfx_mapping"
76+
77+
# Get the destination directory
78+
result = download_manager.download_file(filename, directory, destination="not_a_dir")

0 commit comments

Comments
 (0)