Add test_clear for PlotDataItem class

This commit is contained in:
Billy Su 2018-04-05 11:13:58 +08:00
parent 7b9ba8634c
commit e4254172a5

View File

@ -49,3 +49,12 @@ def test_setData():
pdi.setData({'x': x, 'y': y})
assert len(pdi.xData) == 200
assert len(pdi.yData) == 200
def test_clear():
y = list(np.random.normal(size=100))
x = np.linspace(5, 10, 100)
pdi = pg.PlotDataItem(x, y)
pdi.clear()
assert pdi.xData == None
assert pdi.yData == None