def test_add_reset_event(self): bl = BaseLine(x="key", y="val") self.result = None def test_func(event, callback): self.result = callback bl.add_event = test_func # test the following function behavior bl.add_reset_event(self.dashboard) assert self.result.__name__ == "reset_callback"
def test_add_reset_event(self, dashboard): bl = BaseLine(x="key", y="val") bl.chart = hv.InteractiveDatashader() self.result = None def test_func(event, callback): self.result = callback bl.add_event = test_func # test the following function behavior bl.add_reset_event(dashboard) assert bl.selected_indices is None
def test_add_events(self, event, result): bl = BaseLine(x="key", y="val") self.result = None def test_func(cls): self.result = "func_Called" bl.add_reset_event = test_func bl.reset_event = event # test the following function behavior bl.add_events(self.dashboard) assert self.result == result
def test_add_events(self, dashboard, event, result): bl = BaseLine(x="key", y="val") bl.chart = hv.InteractiveDatashader() self.result = None def test_func(cls): self.result = "func_Called" bl.add_reset_event = test_func bl.reset_event = event # test the following function behavior bl.add_events(dashboard) assert self.result == result