X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader5.py;h=71b61df75d229e97daa5b9ec2479d972437e6c3a;hb=a741b2ebf9a2b28e453ed2021e4cfd32a48502c8;hp=9fbf6eb9b49d5684536f8402519262275e31f4af;hpb=d170abf6cb7fa44827057ce004760d1ef45d9f2d;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader5.py b/src/Plugins/MEDReader/Test/testMEDReader5.py index 9fbf6eb9..71b61df7 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader5.py +++ b/src/Plugins/MEDReader/Test/testMEDReader5.py @@ -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 @@ -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()