Salome HOME
update to use salome test driver
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A1.py
index 17fc4c806872b712e5ef3291f58c689a633ce703..fcf0751ab32da65203e063bd517979541e8ee304 100755 (executable)
@@ -1,9 +1,9 @@
-# Copyright (C) 2010-2012  CEA/DEN, EDF R&D
+# Copyright (C) 2010-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 # This case corresponds to: /visu/2D_viewer/A1 case
 
-from paravistest import test_values
-from pvsimple import CreateXYPlotView
+from paravistest import *
+from presentations import *
+from pvsimple import *
 
 # Create view
 aXYPlot = CreateXYPlotView()
+Render(aXYPlot)
+
+error = 0
+
+# Apply custom axes range
+Etvalue = (1, 1, 1, 1)
+aXYPlot.LeftAxisUseCustomRange, aXYPlot.BottomAxisUseCustomRange, aXYPlot.RightAxisUseCustomRange, aXYPlot.TopAxisUseCustomRange = 1, 1, 1, 1
+Ranges = aXYPlot.LeftAxisUseCustomRange, aXYPlot.BottomAxisUseCustomRange, aXYPlot.RightAxisUseCustomRange, aXYPlot.TopAxisUseCustomRange
+error = error + test_values(Ranges, Etvalue)
+
+# Set custom axes range
+aXYPlot.LeftAxisUseCustomRange = 1
+aXYPlot.BottomAxisUseCustomRange = 1
 
-# Set range
-axisRange = aXYPlot.AxisRange
 # Left axis range
-axisRange[0:2] = [200., 800.]
-Ranges = aXYPlot.AxisRange
-Etvalue = [200, 800, axisRange[2], axisRange[3],
-           axisRange[4], axisRange[5], axisRange[6], axisRange[7] ]
-error = test_values(Ranges, Etvalue)
+Etvalue = (200., 800.)
+aXYPlot.LeftAxisRangeMinimum, aXYPlot.LeftAxisRangeMaximum = Etvalue
+Ranges = aXYPlot.LeftAxisRangeMinimum, aXYPlot.LeftAxisRangeMaximum
+error = error + test_values(Ranges, Etvalue)
+
 # Bottom axis range
-aXYPlot.AxisRange[2:4] = [350.,750.]
-Ranges = aXYPlot.AxisRange
-Etvalue = [200, 800, 350, 750,
-           axisRange[4], axisRange[5], axisRange[6], axisRange[7]]
+Etvalue = (350., 750.)
+aXYPlot.BottomAxisRangeMinimum, aXYPlot.BottomAxisRangeMaximum = Etvalue
+Ranges = aXYPlot.BottomAxisRangeMinimum, aXYPlot.BottomAxisRangeMaximum
 error = error + test_values(Ranges, Etvalue)
-# Left and bottom axis range
-aXYPlot.AxisRange[0:4] = [1350.,2750.,240.,2230.]
-Ranges=aXYPlot.AxisRange
-Etvalue=[1350.,2750.,240.,2230.,
-         axisRange[4], axisRange[5], axisRange[6], axisRange[7]]
+
+# Right axis range
+Etvalue = (0., 300.)
+aXYPlot.RightAxisRangeMinimum, aXYPlot.RightAxisRangeMaximum = Etvalue
+Ranges = aXYPlot.RightAxisRangeMinimum, aXYPlot.RightAxisRangeMaximum
 error = error + test_values(Ranges, Etvalue)
-# Left, bottom, right and top axis range
-aXYPlot.AxisRange = [0, 200, 100, 450, 0, 200, 100, 450]
-Ranges = aXYPlot.AxisRange
-Etvalue = [0, 200, 100, 450, 0, 200, 100, 450]
+
+# Top axis range
+Etvalue = (100., 450.)
+aXYPlot.TopAxisRangeMinimum, aXYPlot.TopAxisRangeMaximum = Etvalue
+Ranges = aXYPlot.TopAxisRangeMinimum, aXYPlot.TopAxisRangeMaximum
 error = error + test_values(Ranges, Etvalue)
 
 if error > 0: