X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingBasicsTest2.py;h=f48cf9edb6dd2f0ffb4fea473c3458e171d51172;hb=8be544a31d08ec0537eef57b60edd48bc70c22db;hp=fabd7936e15cc221def888d8886bf45918d8db11;hpb=f69372fbd5c16c9923633938f0a57e58cd8f4fd5;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py index fabd7936e..f48cf9edb 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2007-2015 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 @@ -1870,6 +1870,19 @@ class MEDCouplingBasicsTest2(unittest.TestCase): da2.setIJ(1,0,1.+1.e-11); self.assertTrue(not da2.isUniform(1.,1.e-12)); pass + + def testDAHasUniqueValues1(self): + da=DataArrayInt([1,2,3,4,5]) + self.assertTrue(da.hasUniqueValues()) + da[1,0] = 5 + self.assertFalse(da.hasUniqueValues()) + da=DataArrayInt([]) + self.assertTrue(da.hasUniqueValues()) + da=DataArrayInt([(1,2), (2,3)]) # wrong num of compo + self.assertRaises(InterpKernelException, da.hasUniqueValues) + da=DataArrayInt() # non allocated array + self.assertRaises(InterpKernelException, da.hasUniqueValues) + pass def testDADFromPolarToCart1(self): tab1=[2.,0.2,2.5,0.7]