Salome HOME
Non regression test for bug ExtractCellType filter (PV Threshold filter)
[modules/paravis.git] / src / Plugins / MEDReader / Test / testMEDReader12.py
old mode 100755 (executable)
new mode 100644 (file)
index 5c700b6..d41de3a
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+# Copyright (C) 2007-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
@@ -86,10 +86,24 @@ a1_POROSITE_PVLookupTable = GetLookupTableForArray( "POROSITE", 1, RGBPoints=[0.
 a1_POROSITE_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.4734426322438599, 0.0, 0.5, 0.0, 0.5814307903048255, 1.0, 0.5, 0.0] )
 
 DataRepresentation2.ScalarOpacityFunction = a1_POROSITE_PiecewiseFunction
-DataRepresentation2.ColorArrayName = ('CELL_DATA', 'POROSITE')
+DataRepresentation2.ColorArrayName = ('CELLS', 'POROSITE')
 DataRepresentation2.LookupTable = a1_POROSITE_PVLookupTable
-DataRepresentation2.ColorAttributeType = 'CELL_DATA'
 
-Render()
 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, "testMEDReader12.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()