File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments