summaryrefslogtreecommitdiff
path: root/silx/sx/test/test_sx.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/sx/test/test_sx.py')
-rw-r--r--silx/sx/test/test_sx.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/silx/sx/test/test_sx.py b/silx/sx/test/test_sx.py
index d264779..ec95838 100644
--- a/silx/sx/test/test_sx.py
+++ b/silx/sx/test/test_sx.py
@@ -24,7 +24,7 @@
# ###########################################################################*/
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "05/10/2018"
+__date__ = "06/11/2018"
import logging
@@ -38,8 +38,16 @@ from silx.gui import qt
# load TestCaseQt before sx
from silx.gui.utils.testutils import TestCaseQt
from silx.gui.colors import rgba
+from silx.gui.colors import Colormap
from silx import sx
+try:
+ import OpenGL
+except ImportError:
+ has_opengl = False
+else:
+ has_opengl = True
+
_logger = logging.getLogger(__name__)
@@ -109,10 +117,14 @@ class SXTest(TestCaseQt, ParametricTestCase):
plt = sx.imshow(img)
self._expose_and_close(plt)
- # image, gray cmap
+ # image, named cmap
plt = sx.imshow(img, cmap='jet', title='jet cmap')
self._expose_and_close(plt)
+ # image, custom colormap
+ plt = sx.imshow(img, cmap=Colormap(), title='custom colormap')
+ self._expose_and_close(plt)
+
# image, log cmap
plt = sx.imshow(img, norm='log', title='log cmap')
self._expose_and_close(plt)
@@ -188,6 +200,7 @@ class SXTest(TestCaseQt, ParametricTestCase):
plt.setAttribute(qt.Qt.WA_DeleteOnClose)
plt.close()
+ @unittest.skipUnless(has_opengl, 'OpenGL not installed')
@unittest.skipUnless(test_options.WITH_GL_TEST,
test_options.WITH_GL_TEST_REASON)
def test_contour3d(self):
@@ -239,6 +252,7 @@ class SXTest(TestCaseQt, ParametricTestCase):
self.assertEqual(rgba(isosurfaces[0].getColor()),
(0., 0., 0., 0.4))
+ @unittest.skipUnless(has_opengl, 'OpenGL not installed')
@unittest.skipUnless(test_options.WITH_GL_TEST,
test_options.WITH_GL_TEST_REASON)
def test_points3d(self):