from datetime import datetime
from MEDCouplingDataForTest import MEDCouplingDataForTest
import rlcompleter,readline # this line has to be here, to ensure a usability of MEDCoupling/MEDLoader. B4 removing it please notify to anthony.geay@cea.fr
-import six
-from six.moves import range
class MEDCouplingBasicsTest3(unittest.TestCase):
def testSwigGetItem1(self):
it2=da2.__iter__()
i=0
for it in da:
- pt = six.next(it2)
+ pt = next(it2)
it[:]=pt
pass
self.assertTrue(da.isEqual(da2))
it2=da2.__iter__()
i=0
for it in da:
- pt = six.next(it2)
+ pt = next(it2)
it[:]=pt
pass
self.assertTrue(da.isEqual(da2,1e-12))
from datetime import datetime
from MEDCouplingDataForTest import MEDCouplingDataForTest
import rlcompleter,readline # this line has to be here, to ensure a usability of MEDCoupling/MEDLoader. B4 removing it please notify to anthony.geay@cea.fr
-import six
-from six.moves import range
class MEDCouplingBasicsTest5(unittest.TestCase):
def testSwig2FieldDoubleBuildSubPartRange1(self):
def testSwigBugOnUnpackingTuplesInDataArray1(self):
inp=DataArrayDouble([(1,2,3),(4,5,6),(7,8,9),(10,11,12)])
it=inp.__iter__()
- r = six.next(it)
+ r = next(it)
self.assertRaises(StopIteration,r.__getitem__,4)
self.assertEqual(len(r),3)
a,b,c=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
d,e,f=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
g,h,i=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
j,k,l=r
self.assertTrue(inp.isEqual(DataArrayDouble([a,b,c,d,e,f,g,h,i,j,k,l],4,3),1e-12))
########
inp=DataArrayInt([(1,2,3),(4,5,6),(7,8,9),(10,11,12)])
it=inp.__iter__()
- r = six.next(it)
+ r = next(it)
self.assertRaises(StopIteration,r.__getitem__,4)
self.assertEqual(len(r),3)
a,b,c=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
d,e,f=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
g,h,i=r
- r = six.next(it)
+ r = next(it)
self.assertEqual(len(r),3)
j,k,l=r
self.assertTrue(inp.isEqual(DataArrayInt([a,b,c,d,e,f,g,h,i,j,k,l],4,3)))