summaryrefslogtreecommitdiff
path: root/silx/gui/plot/test/testPlotWindow.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2021-01-06 14:10:12 +0100
committerPicca Frédéric-Emmanuel <picca@debian.org>2021-01-06 14:10:12 +0100
commitb3bea947efa55d2c0f198b6c6795b3177be27f45 (patch)
tree4116758aafe4483bf472c1d54b519e685737fd77 /silx/gui/plot/test/testPlotWindow.py
parent5ad425ff4e62f5e003178813ebd073577679a00e (diff)
New upstream version 0.14.0+dfsg
Diffstat (limited to 'silx/gui/plot/test/testPlotWindow.py')
-rw-r--r--silx/gui/plot/test/testPlotWindow.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/silx/gui/plot/test/testPlotWindow.py b/silx/gui/plot/test/testPlotWindow.py
index 8e7b35c..e12b756 100644
--- a/silx/gui/plot/test/testPlotWindow.py
+++ b/silx/gui/plot/test/testPlotWindow.py
@@ -33,12 +33,12 @@ import unittest
import numpy
from silx.gui.utils.testutils import TestCaseQt, getQToolButtonFromAction
+from silx.test.utils import test_options
from silx.gui import qt
from silx.gui.plot import PlotWindow
from silx.gui.colors import Colormap
-
class TestPlotWindow(TestCaseQt):
"""Base class for tests of PlotWindow."""
@@ -155,6 +155,25 @@ class TestPlotWindow(TestCaseQt):
self.assertEqual(self._count, 1)
del self._count
+ @unittest.skipUnless(test_options.WITH_GL_TEST,
+ test_options.WITH_QT_TEST_REASON)
+ def testSwitchBackend(self):
+ """Test switching an empty plot"""
+ self.plot.resetZoom()
+ xlimits = self.plot.getXAxis().getLimits()
+ ylimits = self.plot.getYAxis().getLimits()
+ isKeepAspectRatio = self.plot.isKeepDataAspectRatio()
+
+ for backend in ('gl', 'mpl'):
+ with self.subTest():
+ self.plot.setBackend(backend)
+ self.plot.replot()
+ self.assertEqual(self.plot.getXAxis().getLimits(), xlimits)
+ self.assertEqual(self.plot.getYAxis().getLimits(), ylimits)
+ self.assertEqual(
+ self.plot.isKeepDataAspectRatio(), isKeepAspectRatio)
+
+
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(