X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader4.py;h=fd51b93f42194bcb48e9e6d4ed8e9076d840a235;hb=7f73f7630e2938bcd12c9736c95ab0b72ec8a072;hp=488a4e9b47418b2031c50646174a44fb2911b686;hpb=d170abf6cb7fa44827057ce004760d1ef45d9f2d;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader4.py b/src/Plugins/MEDReader/Test/testMEDReader4.py index 488a4e9b..fd51b93f 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader4.py +++ b/src/Plugins/MEDReader/Test/testMEDReader4.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D +# Copyright (C) 2007-2017 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 @@ -42,7 +42,7 @@ f1ts1=MEDFileField1TS() f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m0) ; f0.setName("f0NoPfl") arr0=DataArrayDouble([0.,1.,2.,3.,1.,1.5,2.2,3.1,2.,2.2,3.,3.1,3.,3.1,3.5,4.]) f0.setArray(arr0) -f0.checkCoherency() +f0.checkConsistencyLight() f1ts0.setFieldNoProfileSBT(f0) # pfl1=DataArrayInt([0,1,2,3,4,5,6,8,9,12]) ; pfl1.setName("pfl1") @@ -68,9 +68,9 @@ testMEDReader4_med=MEDReader(FileName=fname) testMEDReader4_med.AllArrays=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSup0/mesh@@][@@P1'] #testMEDReader4_med.AllTimeSteps=['0000'] -Glyph1=Glyph(GlyphType="Sphere",GlyphTransform="Transform2" ) +Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere') Glyph1.Scalars=['POINTS','f0NoPfl'] -Glyph1.SetScaleFactor=0.3 +Glyph1.ScaleFactor=0.3 Glyph1.Vectors=['POINTS', ''] Glyph1.GlyphTransform="Transform2" @@ -87,9 +87,24 @@ DataRepresentation1.LookupTable = lookupTable RenderView1 = GetRenderView() RenderView1.CameraViewUp = [0.06254683966704512, 0.9980420295997885, 0.0] RenderView1.CameraPosition = [0.8087292125440382, 1.3325993334207897, 12.692130429902462] -RenderView1.CameraClippingRange = [6.326709113742113, 7.168262401281963] RenderView1.CameraFocalPoint = [0.8087292125440382, 1.3325993334207897, 0.0] RenderView1.CameraParallelScale = 3.712804729456109 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, "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()