diff options
Diffstat (limited to 'silx/gui/plot/test/testStackView.py')
-rw-r--r-- | silx/gui/plot/test/testStackView.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/silx/gui/plot/test/testStackView.py b/silx/gui/plot/test/testStackView.py index 80c85d6..7605bbc 100644 --- a/silx/gui/plot/test/testStackView.py +++ b/silx/gui/plot/test/testStackView.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2016-2019 European Synchrotron Radiation Facility +# Copyright (c) 2016-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -60,6 +60,19 @@ class TestStackView(TestCaseQt): del self.stackview super(TestStackView, self).tearDown() + def testScaleColormapRangeToStack(self): + """Test scaleColormapRangeToStack""" + self.stackview.setStack(self.mystack) + self.stackview.setColormap("viridis") + colormap = self.stackview.getColormap() + + # Colormap autoscale to image + self.assertEqual(colormap.getVRange(), (None, None)) + self.stackview.scaleColormapRangeToStack() + + # Colormap range set according to stack range + self.assertEqual(colormap.getVRange(), (self.mystack.min(), self.mystack.max())) + def testSetStack(self): self.stackview.setStack(self.mystack) self.stackview.setColormap("viridis", autoscale=True) |