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

Method testAsString

tools/swig/test/testFarray.py:104–116  ·  view source on GitHub ↗

Test Farray asString method

(self)

Source from the content-addressed store, hash-verified

102 self.assertRaises(IndexError, self.array.__getitem__, (0, self.ncols+1))
103
104 def testAsString(self):
105 "Test Farray asString method"
106 result = """\
107[ [ 0, 1, 2, 3 ],
108 [ 1, 2, 3, 4 ],
109 [ 2, 3, 4, 5 ],
110 [ 3, 4, 5, 6 ],
111 [ 4, 5, 6, 7 ] ]
112"""
113 for i in range(self.nrows):
114 for j in range(self.ncols):
115 self.array[i, j] = i+j
116 self.assertTrue(self.array.asString() == result)
117
118 def testStr(self):
119 "Test Farray __str__ method"

Callers

nothing calls this directly

Calls 1

asStringMethod · 0.45

Tested by

no test coverage detected