Salome HOME
Porting tests to new PV version
[modules/paravis.git] / src / Plugins / MEDReader / Test / testMEDReader4.py
index 9866808318194d11afb2ebc9a82c4f4295b4f405..3f88aa9bf0f3610cae2a70fa0b432b8200f8edf0 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2017  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019  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
@@ -19,6 +19,9 @@
 #
 # Author : Anthony Geay
 
+import os
+import sys
+
 from MEDLoader import *
 
 """ This test checks that umeshes with no names work properly.
@@ -69,9 +72,9 @@ testMEDReader4_med.AllArrays=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSu
 #testMEDReader4_med.AllTimeSteps=['0000']
 
 Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere')
-Glyph1.Scalars=['POINTS','f0NoPfl']
+Glyph1.ScaleArray=['POINTS','f0NoPfl']
 Glyph1.ScaleFactor=0.3
-Glyph1.Vectors=['POINTS', '']
+Glyph1.OrientationArray = ['POINTS', 'No orientation array']
 Glyph1.GlyphTransform="Transform2"
 
 DataRepresentation1 = Show()
@@ -84,27 +87,27 @@ function=CreatePiecewiseFunction(Points=[0.0,0.0,0.5,0.0,1.0,1.0,0.5,0.0] )
 lookupTable.ScalarOpacityFunction = function
 DataRepresentation1.LookupTable = lookupTable
 
-RenderView1 = GetRenderView()
-RenderView1.CameraViewUp = [0.06254683966704512, 0.9980420295997885, 0.0]
-RenderView1.CameraPosition = [0.8087292125440382, 1.3325993334207897, 12.692130429902462]
-RenderView1.CameraFocalPoint = [0.8087292125440382, 1.3325993334207897, 0.0]
-RenderView1.CameraParallelScale = 3.712804729456109
+if '-D' not in sys.argv:
+  RenderView1 = GetRenderView()
+  RenderView1.CameraViewUp = [0.06254683966704512, 0.9980420295997885, 0.0]
+  RenderView1.CameraPosition = [0.8087292125440382, 1.3325993334207897, 12.692130429902462]
+  RenderView1.CameraFocalPoint = [0.8087292125440382, 1.3325993334207897, 0.0]
+  RenderView1.CameraParallelScale = 3.712804729456109
 
-RenderView1.ViewSize =[300,300]
-Render()
+  RenderView1.ViewSize =[300,300]
+  Render()
 
-# compare with baseline image
-import os
-import sys
-try:
-  baselineIndex = sys.argv.index('-B')+1
-  baselinePath = sys.argv[baselineIndex]
-except:
-  print("Could not get baseline directory. Test failed.")
-  exit(1)
-baseline_file = os.path.join(baselinePath, "testMEDReader4.png")
-import vtk.test.Testing
-vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir()
-vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file,
-                                                            threshold=1)
-vtk.test.Testing.interact()
+  # compare with baseline image
+  try:
+    baselineIndex = sys.argv.index('-B')+1
+    baselinePath = sys.argv[baselineIndex]
+  except:
+    print("Could not get baseline directory. Test failed.")
+    exit(1)
+  baseline_file = os.path.join(baselinePath, "testMEDReader4.png")
+  import vtk.test.Testing
+  from vtk.util.misc import vtkGetTempDir
+  vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir()
+  vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file,
+                                                              threshold=1)
+  vtk.test.Testing.interact()