MCPcopy Create free account
hub / github.com/numpy/numpy / testSetGet1

Method testSetGet1

tools/swig/test/testArray.py:190–201  ·  view source on GitHub ↗

Test Array2 __setitem__, __getitem__ methods

(self)

Source from the content-addressed store, hash-verified

188 self.assertRaises(ValueError, self.array2.resize, 5, -5)
189
190 def testSetGet1(self):
191 "Test Array2 __setitem__, __getitem__ methods"
192 m = self.nrows
193 n = self.ncols
194 array1 = [ ]
195 a = np.arange(n, dtype="l")
196 for i in range(m):
197 array1.append(Array.Array1(i*a))
198 for i in range(m):
199 self.array2[i] = array1[i]
200 for i in range(m):
201 self.assertTrue(self.array2[i] == array1[i])
202
203 def testSetGet2(self):
204 "Test Array2 chained __setitem__, __getitem__ methods"

Callers

nothing calls this directly

Calls 1

Array1Method · 0.80

Tested by

no test coverage detected