Salome HOME
Various fixes for test runs - introducing MEDCOUPLING_RESOURCE_DIR env variable
[tools/medcoupling.git] / src / ParaMEDMEM_Swig / test_StructuredCoincidentDEC.py
index 171c25fed1e750bd04b7edd050972c70728a1c7e..f110cae6f6e7b1b919f1ac79aab80ffb86d0200a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2020  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
@@ -32,7 +32,7 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase):
         rank = MPI_Comm_rank(MPI_COMM_WORLD)
         #
         if size < 4:
-            raise RuntimeError, "Expect MPI_COMM_WORLD size >= 4"
+            raise RuntimeError("Expect MPI_COMM_WORLD size >= 4")
         #
         interface = CommInterface()
         #
@@ -67,7 +67,7 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase):
             paramesh=ParaMESH(mesh,source_group,"source mesh")
             comptopo=ComponentTopology(6)
             parafield=ParaFIELD(ON_CELLS,NO_TIME,paramesh,comptopo)
-            parafield.getField().setNature(ConservativeVolumic)
+            parafield.getField().setNature(IntensiveMaximum)
             nb_local=mesh.getNumberOfCells()
             global_numbering=paramesh.getGlobalNumberingCell2()
             value = []
@@ -90,7 +90,7 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase):
             paramesh=ParaMESH(mesh, self_group, "target mesh")
             comptopo=ComponentTopology(6,target_group)
             parafield=ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
-            parafield.getField().setNature(ConservativeVolumic)
+            parafield.getField().setNature(IntensiveMaximum)
             nb_local=mesh.getNumberOfCells()
             value = [0.0]*(nb_local*comptopo.nbLocalComponents())
             parafield.getField().setValues(value)
@@ -103,7 +103,7 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase):
             for i in range(nb_local):
                 first=comptopo.firstLocalComponent()
                 for icomp in range(comptopo.nbLocalComponents()):
-                    self.failUnless(math.fabs(recv_value[i*comptopo.nbLocalComponents()+icomp]-
+                    self.assertTrue(math.fabs(recv_value[i*comptopo.nbLocalComponents()+icomp]-
                                               (float)(i*6+icomp+first))<1e-12)
                     pass
                 pass
@@ -121,7 +121,7 @@ class ParaMEDMEMBasicsTest2(unittest.TestCase):
         source_group = 0
         MPI_Barrier(MPI_COMM_WORLD)
         MPI_Finalize()
-        print "End of test StructuredCoincidentDEC"
+        print("End of test StructuredCoincidentDEC")
         pass