MCPcopy Index your code
hub / github.com/numpy/numpy / test_startswith

Method test_startswith

numpy/_core/tests/test_defchararray.py:360–369  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

358 assert_(issubclass(np.char.rindex('abcba', 'b').dtype.type, np.integer))
359
360 def test_startswith(self):
361 A = self.A()
362 assert_(issubclass(A.startswith('').dtype.type, np.bool))
363 assert_array_equal(A.startswith(' '), [[1, 0], [0, 0], [0, 0]])
364 assert_array_equal(A.startswith('1', 0, 3), [[0, 0], [1, 0], [1, 0]])
365
366 def fail():
367 A.startswith('3', 'fdjk')
368
369 assert_raises(TypeError, fail)
370
371@ignore_charray_deprecation
372class TestMethods:

Callers

nothing calls this directly

Calls 5

AMethod · 0.95
assert_Function · 0.90
assert_array_equalFunction · 0.90
assert_raisesFunction · 0.90
startswithMethod · 0.80

Tested by

no test coverage detected