Skip to content

Commit

Permalink
TEST: Fixed csv file upload test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 committed May 3, 2024
1 parent 746884c commit d0b468a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,12 @@ def test_gui_upload_csv_simulation():
# Relative path to the file
file_relative_path = "./hnn_core/tests/assets/test_default.csv"
absolute_path = os.path.abspath(file_relative_path)
# Get the absolute path of the file
file_url = 'file://' + absolute_path.replace(os.sep, '/')
if os.name == 'nt': # Windows
# Convert backslashes to forward slashes and
# ensure we have three slashes after 'file:'
file_url = 'file:///' + absolute_path.replace('\\', '/')
else: # UNIX-like systems
file_url = 'file://' + absolute_path
_ = gui._simulate_upload_data(file_url)
# gui.load_data_button.set_trait('value', uploaded_value)
assert len(gui.data['simulation_data']) == 1
Expand Down

0 comments on commit d0b468a

Please sign in to comment.