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

Method test_capitalize

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

Source from the content-addressed store, hash-verified

319 ['123 \t 345 \0 ', 'UPPER']]).view(np.chararray)
320
321 def test_capitalize(self):
322 tgt = [[b' abc ', b''],
323 [b'12345', b'Mixedcase'],
324 [b'123 \t 345 \0 ', b'Upper']]
325 assert_(issubclass(self.A.capitalize().dtype.type, np.bytes_))
326 assert_array_equal(self.A.capitalize(), tgt)
327
328 tgt = [[' \u03c3 ', ''],
329 ['12345', 'Mixedcase'],
330 ['123 \t 345 \0 ', 'Upper']]
331 assert_(issubclass(self.B.capitalize().dtype.type, np.str_))
332 assert_array_equal(self.B.capitalize(), tgt)
333
334 def test_center(self):
335 assert_(issubclass(self.A.center(10).dtype.type, np.bytes_))

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_array_equalFunction · 0.90
capitalizeMethod · 0.80

Tested by

no test coverage detected