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

Method test_swapcase

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

Source from the content-addressed store, hash-verified

522 assert_(len(A[0]) == 3)
523
524 def test_swapcase(self):
525 tgt = [[b' ABC ', b''],
526 [b'12345', b'mIXEDcASE'],
527 [b'123 \t 345 \0 ', b'upper']]
528 assert_(issubclass(self.A.swapcase().dtype.type, np.bytes_))
529 assert_array_equal(self.A.swapcase(), tgt)
530
531 tgt = [[' \u03c3 ', ''],
532 ['12345', 'mIXEDcASE'],
533 ['123 \t 345 \0 ', 'upper']]
534 assert_(issubclass(self.B.swapcase().dtype.type, np.str_))
535 assert_array_equal(self.B.swapcase(), tgt)
536
537 def test_title(self):
538 tgt = [[b' Abc ', b''],

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_array_equalFunction · 0.90
swapcaseMethod · 0.80

Tested by

no test coverage detected