diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index ca502a95c5..6d4975ef2e 100644 --- a/hnn_core/gui/gui.py +++ b/hnn_core/gui/gui.py @@ -1452,10 +1452,10 @@ def _serialize_simulation(log_out, sim_data, simulation_list_widget): def serialize_simulation(simulations_data, simulation_name): """Serializes simulation data to CSV. - - Creates a single CSV file or a ZIP file containing multiple CSVs, + + Creates a single CSV file or a ZIP file containing multiple CSVs, depending on the number of trials in the simulation. - + """ simulation_data = simulations_data["simulation_data"] csv_trials_output = [] diff --git a/hnn_core/tests/test_gui.py b/hnn_core/tests/test_gui.py index e873724b2a..ff00f72ff6 100644 --- a/hnn_core/tests/test_gui.py +++ b/hnn_core/tests/test_gui.py @@ -625,8 +625,19 @@ def test_gui_upload_csv_simulation(): file_url = 'file://' + absolute_path _ = gui._simulate_upload_data(file_url) + # we are loading only 1 trial, + # assume all the data we need is in the [0] position + data_lengh = ( + len(gui.data['simulation_data']['test_default']['dpls'][0].times)) + assert len(gui.data['simulation_data']) == 1 assert 'test_default' in gui.data['simulation_data'].keys() assert gui.data['simulation_data']['test_default']['net'] is None assert type(gui.data['simulation_data']['test_default']['dpls']) is list assert len(gui.viz_manager.data['figs']) == 1 + assert (len(gui.data['simulation_data']['test_default'] + ['dpls'][0].data['agg']) == data_lengh) + assert (len(gui.data['simulation_data']['test_default'] + ['dpls'][0].data['L2']) == data_lengh) + assert (len(gui.data['simulation_data']['test_default'] + ['dpls'][0].data['L5']) == data_lengh)