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

Method test_startswith

numpy/core/tests/test_defchararray.py:300–308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

298 assert_(issubclass(np.char.rindex('abcba', 'b').dtype.type, np.integer))
299
300 def test_startswith(self):
301 assert_(issubclass(self.A.startswith('').dtype.type, np.bool_))
302 assert_array_equal(self.A.startswith(' '), [[1, 0], [0, 0], [0, 0]])
303 assert_array_equal(self.A.startswith('1', 0, 3), [[0, 0], [1, 0], [1, 0]])
304
305 def fail():
306 self.A.startswith('3', 'fdjk')
307
308 assert_raises(TypeError, fail)
309
310
311class TestMethods:

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
assert_array_equalFunction · 0.90
assert_raisesFunction · 0.90
startswithMethod · 0.80

Tested by

no test coverage detected