Exemplo n.º 1
0
 def test1DIterationOffsetRange(self):
     """test1DIterationOffsetRange: should be able to iterate over a 1D Array with offset range"""
     a = vbObjectInitialize(((5, 10),), Integer)		
     for i in range(5, 11):
         a[i] = i
     for i, j in zip(range(5, 11), a):
         self.assertEqual(i, j)
Exemplo n.º 2
0
 def test1DIteration(self):
     """test1DIteration: should be able to iterate over a 1D Array"""
     a = vbObjectInitialize((10,), Integer)		
     for i in range(0, 11):
         a[i] = i
     for i, j in zip(range(11), a):
         self.assertEqual(i, j)
Exemplo n.º 3
0
 def test2DOffsetRange(self):
     """test2DOffsetRange: should be able to create a 2D Array with offset range"""
     a = vbObjectInitialize(((5, 10), (-5, 5)), String)		
     self.assertEqual(len(a), 6)
     self.assertEqual(len(a(5)), 11)
     for i in range(5, 11):
         for j in range(-5, 6):
             self.assertEqual(a(i, j), "")
Exemplo n.º 4
0
 def test2D(self):
     """test2D: should be able to create a 2D Array"""
     a = vbObjectInitialize((10, 5), String)		
     self.assertEqual(len(a), 11)
     self.assertEqual(len(a(0)), 6)
     for i in range(0, 11):
         for j in range(0, 6):
             self.assertEqual(a(i, j), "")
Exemplo n.º 5
0
 def test1DOffsetRange(self):
     """test1DOffsetRange: should be able to create a 1D Array with an offset range"""
     a = vbObjectInitialize(((5,10),), String)		
     self.assertEqual(len(a), 6)
     for i in range(5, 11):
         self.assertEqual(a(i), "")
     self.assertRaises(IndexError, a.__getitem__, 4)	
     self.assertRaises(IndexError, a.__getitem__, 11)
Exemplo n.º 6
0
 def test2DIterationOffsetRange(self):
     """test2DIterationOffsetRange: should be able to iterate over a 2D Array with an offset range"""
     a = vbObjectInitialize(((5, 10),(10, 20)), Integer)		
     for i in range(5, 11):
         for j in range(10, 21):
             a[i, j] = i*j
     for i, arr in zip(range(5, 11), a):
         for j, result in zip(range(10, 21), arr):
             self.assertEqual(i*j, result)
Exemplo n.º 7
0
 def test2DIteration(self):
     """test2DIteration: should be able to iterate over a 2D Array"""
     a = vbObjectInitialize((10,20), Integer)		
     for i in range(0, 11):
         for j in range(0, 21):
             a[i, j] = i*j
     for i, arr in zip(range(11), a):
         for j, result in zip(range(21), arr):
             self.assertEqual(i*j, result)
Exemplo n.º 8
0
 def test1D(self):
     """test1D: should be able to create a 1D Array"""
     a = vbObjectInitialize((10,), String)		
     self.assertEqual(len(a), 11)
     for i in range(0, 11):
         self.assertEqual(a(i), "")