Example #1
0
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
Example #2
0
class TestStandaloneImageWidget(object):
    def setup_method(self, method):
        im = np.random.random((3, 3))
        self.w = StandaloneImageWidget(im)

    def test_set_cmap(self):
        cm_mode = self.w.toolbar.tools['image:colormap']
        act = cm_mode.menu_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
Example #3
0
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
Example #4
0
class TestStandaloneImageWidget(object):

    def setup_method(self, method):
        im = np.random.random((3, 3))
        self.w = StandaloneImageWidget(im)

    def test_set_cmap(self):
        cm_mode = self.w.toolbar.tools['image:colormap']
        act = cm_mode.menu_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
Example #5
0
 def setup_method(self, method):
     im = np.random.random((3, 3))
     self.w = StandaloneImageWidget(im)
Example #6
0
 def setup_method(self, method):
     im = np.random.random((3, 3))
     self.w = StandaloneImageWidget(im)