X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader8.py;h=58d263a7351b22dd817dffbbe97b041f330dcf52;hb=a741b2ebf9a2b28e453ed2021e4cfd32a48502c8;hp=3571776f835d52ac305cbbf95d53c97b84c93dd8;hpb=73802da00d28607ee79ae982267526b4f71f8c9e;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader8.py b/src/Plugins/MEDReader/Test/testMEDReader8.py index 3571776f..58d263a7 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader8.py +++ b/src/Plugins/MEDReader/Test/testMEDReader8.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 @@ -70,14 +70,12 @@ myMedReader.AllArrays = ['TS0/mesh/ComSup0/fNode@@][@@P1'] assert(list(myMedReader.TimestepValues)==[0.,1.,2.,3.]) myMedReader.UpdatePipeline() -extractCT=ExtractCellType() -extractCT.Input=myMedReader +extractCT=ExtractCellType(Input=myMedReader) extractCT.UpdatePipelineInformation() assert(list(extractCT.GetProperty("GeoTypesInfo"))==['TRI3','0','QUAD4','0']) extractCT.AllGeoTypes=['TRI3'] -extGrp=ExtractGroup() -extGrp.Input=extractCT +extGrp=ExtractGroup(Input=extractCT) extGrp.UpdatePipelineInformation() assert(filter(lambda x:x[:4]=="GRP_",list(extGrp.GetProperty("GroupsFlagsInfo")[::2]))==['GRP_grp0']) extGrp.AllGroups="GRP_grp0" @@ -106,4 +104,20 @@ RenderView1.ViewTime = 1.0 #### Important # red is in right bottom RenderView1.CacheKey = 1.0 RenderView1.UseCache = 1 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, "testMEDReader8.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()