class TestStandaloneImageWidget(object): def setup_method(self, method): im = np.random.random((3, 3)) self.w = StandaloneImageWidget(im) def test_set_cmap(self): act = self.w._cmap_actions[1] act.trigger() assert self.w._im.cmap is act.cmap def test_double_set_image(self): assert len(self.w._axes.images) == 1 self.w.set_image(np.zeros((3, 3))) assert len(self.w._axes.images) == 1
def setup_method(self, method): im = np.random.random((3, 3)) self.w = StandaloneImageWidget(im)