X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader12.py;h=2649e132cea70386f59f580391fb9100b18754e0;hb=0bf9fea22904ebe22b3c4ef1acffb262d9a85265;hp=8c4e1394d07307df171690407a5e5e55b3d80d39;hpb=37ec15a004a80974e379aa5e364b9b79165d0462;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader12.py b/src/Plugins/MEDReader/Test/testMEDReader12.py index 8c4e1394..2649e132 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader12.py +++ b/src/Plugins/MEDReader/Test/testMEDReader12.py @@ -1,10 +1,10 @@ # -*- 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 # 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 @@ -51,7 +51,7 @@ f1ts.write(fname,0) ################### MED write is done -> Go to MEDReader from paraview.simple import * -testMEDReader12_med = MEDReader( FileName='/export/home/geay/Salome7/V7_3_0/BUG_7972/TRY4/testMEDReader12.med' ) +testMEDReader12_med = MEDReader( FileName=fname ) testMEDReader12_med.AllArrays = ['TS0/Maillage_THYC/ComSup0/POROSITE@@][@@P0'] RenderView1 = GetRenderView() @@ -65,7 +65,6 @@ DataRepresentation1.SelectionCellFieldDataArrayName = 'FamilyIdCell' RenderView1.CameraPosition = [0.10751999914646149, 0.10751999914646149, 5.409578268564619] RenderView1.CameraFocalPoint = [0.10751999914646149, 0.10751999914646149, 4.703749895095825] -RenderView1.CameraClippingRange = [0.4972827225809383, 0.9700468818440346] RenderView1.CameraParallelScale = 0.18268182562745858 ExtractGroup1 = ExtractGroup(Input=testMEDReader12_med) @@ -86,10 +85,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()