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

Method test_swapcase

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

Source from the content-addressed store, hash-verified

641 assert_(len(A[0]) == 3)
642
643 def test_swapcase(self):
644 A, B = self.A(), self.B()
645 tgt = [[b' ABC ', b''],
646 [b'12345', b'mIXEDcASE'],
647 [b'123 \t 345 \0 ', b'upper']]
648 assert_(issubclass(A.swapcase().dtype.type, np.bytes_))
649 assert_array_equal(A.swapcase(), tgt)
650
651 tgt = [[' \u03c3 ', ''],
652 ['12345', 'mIXEDcASE'],
653 ['123 \t 345 \0 ', 'upper']]
654 assert_(issubclass(B.swapcase().dtype.type, np.str_))
655 assert_array_equal(B.swapcase(), tgt)
656
657 def test_title(self):
658 A, B = self.A(), self.B()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected