Salome HOME
Make the vtkMEDReader::META_DATA info key accessible from the outside without dependa...
[modules/paravis.git] / src / Plugins / MEDReader / Test / testMEDReader5.py
index 0f211a2f006c356355e1cfe27fd7afa18d1ce3e7..1c07a227291f9c58e525eaa78b8ecdc8d8ce11c5 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2016  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
@@ -78,8 +78,7 @@ myMedReader=MEDReader(FileName=fname)
 myMedReader.AllArrays = ['TS0/mesh/ComSup1/fNode@@][@@P1']
 myMedReader.AllTimeSteps = ['0000']
 
-Clip1=Clip(ClipType="Plane")
-Clip1.Input=myMedReader
+Clip1=Clip(ClipType="Plane",Input=myMedReader)
 Clip1.Scalars = ['POINTS', 'FamilyIdNode']
 Clip1.ClipType.Origin = [2.0, 2.0, 2.0]
 Clip1.ClipType = "Plane"
@@ -106,10 +105,24 @@ DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
 DataRepresentation2.ScalarOpacityUnitDistance = 1.5768745057161244
 DataRepresentation2.ExtractedBlockIndex = 1
 DataRepresentation2.ScaleFactor = 0.4
-DataRepresentation2.ColorArrayName='fNode'
+DataRepresentation2.ColorArrayName=('POINTS','fNode')
 DataRepresentation2.LookupTable=LookupTable
-DataRepresentation2.ColorAttributeType='POINT_DATA'
-
 
 RenderView1.ViewSize=[300,300]
-WriteImage(outImgName)
+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, "testMEDReader5.png")
+import vtk.test.Testing
+vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir()
+vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file,
+                                                            threshold=25)
+vtk.test.Testing.interact()