def test_data_props_list(self):
"""Test the data properties of Formatoptions with an InteractiveList"""
data = psyd.InteractiveList([xr.DataArray([]), xr.DataArray([])])
plot_data = data.copy(True)
plot_data.extend([xr.DataArray([]), xr.DataArray([])],
new_name=True)
plotter = TestPlotter(data)
plotter.plot_data = plot_data
plot_data = plotter.plot_data # the data might have been copied
self.assertIs(plotter.fmt1.raw_data, data)
self.assertIs(plotter.fmt1.data, plot_data)
# test with index in list
plotter.fmt1.index_in_list = 1
self.assertIs(plotter.fmt1.raw_data, data[1])
self.assertIs(plotter.fmt1.data, plot_data[1])
# test with index in list of plot_data outside raw_data
plotter.fmt1.index_in_list = 3
self.assertIs(plotter.fmt1.data, plot_data[3])
评论列表
文章目录