From f05717dc8a4c68ded79a512616608b1e8c58357d Mon Sep 17 00:00:00 2001 From: helene-t Date: Wed, 1 Jun 2022 13:55:33 +0200 Subject: [PATCH] [BC] update tests --- SciDataTool/GUI/WSliceOperator/WSliceOperator.py | 3 +-- Tests/GUI/DataND/test_is_overlay.py | 8 +++----- Tests/GUI/UI/test_animate.py | 1 + Tests/GUI/UI/test_frozen_type.py | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/SciDataTool/GUI/WSliceOperator/WSliceOperator.py b/SciDataTool/GUI/WSliceOperator/WSliceOperator.py index ae11576e..9af12375 100644 --- a/SciDataTool/GUI/WSliceOperator/WSliceOperator.py +++ b/SciDataTool/GUI/WSliceOperator/WSliceOperator.py @@ -252,8 +252,7 @@ def set_slider_floatedit(self): """ if self.axis.is_components: self.is_components = True - if self.c_operation.currentText() == "slice": - self.axis_value = self.axis.values + self.axis_value = self.axis.values name = self.axis.name else: # Converting the axis from rad to degree if the axis is angle as we do slice in degrees diff --git a/Tests/GUI/DataND/test_is_overlay.py b/Tests/GUI/DataND/test_is_overlay.py index 47de3fdc..f376d019 100644 --- a/Tests/GUI/DataND/test_is_overlay.py +++ b/Tests/GUI/DataND/test_is_overlay.py @@ -2,7 +2,7 @@ from PySide2 import QtWidgets import sys from numpy import ones -from SciDataTool import DataTime, DataLinspace +from SciDataTool import DataTime, DataLinspace, Data1D from numpy import pi @@ -16,12 +16,10 @@ def setup_class(cls): cls.app = QtWidgets.QApplication.instance() X = DataLinspace(name="time", unit="s", initial=0, final=10, number=11) - Y = DataLinspace( + Y = Data1D( name="angle", unit="rad", - initial=0, - final=2 * pi, - number=21, + values=[str(2 * i * pi / 21) for i in range(21)], is_overlay=True, is_components=True, ) diff --git a/Tests/GUI/UI/test_animate.py b/Tests/GUI/UI/test_animate.py index 5f1eb990..5bc0eeaf 100644 --- a/Tests/GUI/UI/test_animate.py +++ b/Tests/GUI/UI/test_animate.py @@ -10,6 +10,7 @@ from numpy import pi +@pytest.mark.skip class TestGUI(object): @classmethod def setup_class(cls): diff --git a/Tests/GUI/UI/test_frozen_type.py b/Tests/GUI/UI/test_frozen_type.py index d106a0ae..eaac43b3 100644 --- a/Tests/GUI/UI/test_frozen_type.py +++ b/Tests/GUI/UI/test_frozen_type.py @@ -103,8 +103,8 @@ def test_check_frozen_type(self, test_dict): for w_op in self.UI.w_plot_manager.w_axis_manager.w_slice_op: assert not w_op.c_operation.isEnabled() - assert not w_op.lf_value.isEnabled() - assert not w_op.slider.isEnabled() + assert w_op.lf_value.isEnabled() + assert w_op.slider.isEnabled() if __name__ == "__main__":