Skip to content

Commit bcba87e

Browse files
TEST multiple data layers
1 parent 9fbfa46 commit bcba87e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

surfer/tests/test_viz.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,27 @@ def time_label(t):
219219
assert_equal(brain.data_dict['lh']['time_idx'], 2)
220220
# viewer = TimeViewer(brain)
221221

222+
# multiple data layers
223+
assert_raises(ValueError, brain.add_data, data, vertices=vertices,
224+
time=time[:-1])
222225
brain.add_data(data, colormap=colormap, vertices=vertices,
223226
smoothing_steps=10, time=time, time_label=time_label,
224-
initial_time=.09, remove_existing=True)
227+
initial_time=.09)
225228
assert_equal(brain.data_dict['lh']['time_idx'], 1)
229+
data_dicts = brain._data_dicts['lh']
230+
assert_equal(len(data_dicts), 2)
231+
assert_equal(data_dicts[0]['time_idx'], 1)
232+
assert_equal(data_dicts[1]['time_idx'], 1)
233+
234+
# shift time in both layers
235+
brain.set_data_time_index(0)
236+
assert_equal(data_dicts[0]['time_idx'], 0)
237+
assert_equal(data_dicts[1]['time_idx'], 0)
238+
239+
# remove all layers
240+
brain.remove_data()
241+
assert_equal(brain._data_dicts['lh'], [])
242+
226243
brain.close()
227244

228245

0 commit comments

Comments
 (0)