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

Method test_capitalize

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

Source from the content-addressed store, hash-verified

383 .view(np.char.chararray)
384
385 def test_capitalize(self):
386 A, B = self.A(), self.B()
387 tgt = [[b' abc ', b''],
388 [b'12345', b'Mixedcase'],
389 [b'123 \t 345 \0 ', b'Upper']]
390 assert_(issubclass(A.capitalize().dtype.type, np.bytes_))
391 assert_array_equal(A.capitalize(), tgt)
392
393 tgt = [[' \u03c3 ', ''],
394 ['12345', 'Mixedcase'],
395 ['123 \t 345 \0 ', 'Upper']]
396 assert_(issubclass(B.capitalize().dtype.type, np.str_))
397 assert_array_equal(B.capitalize(), tgt)
398
399 def test_center(self):
400 A = self.A()

Callers

nothing calls this directly

Calls 5

AMethod · 0.95
BMethod · 0.95
assert_Function · 0.90
assert_array_equalFunction · 0.90
capitalizeMethod · 0.80

Tested by

no test coverage detected