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

Method test_strip

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

Source from the content-addressed store, hash-verified

607 assert_array_equal(B.rstrip(), tgt)
608
609 def test_strip(self):
610 A, B = self.A(), self.B()
611 tgt = [[b'abc', b''],
612 [b'12345', b'MixedCase'],
613 [b'123 \t 345', b'UPPER']]
614 assert_(issubclass(A.strip().dtype.type, np.bytes_))
615 assert_array_equal(A.strip(), tgt)
616
617 tgt = [[b' abc ', b''],
618 [b'234', b'ixedCas'],
619 [b'23 \t 345 \x00', b'UPP']]
620 assert_array_equal(A.strip([b'15', b'EReM']), tgt)
621
622 tgt = [['\u03a3', ''],
623 ['12345', 'MixedCase'],
624 ['123 \t 345', 'UPPER']]
625 assert_(issubclass(B.strip().dtype.type, np.str_))
626 assert_array_equal(B.strip(), tgt)
627
628 def test_split(self):
629 A = self.A().split(b'3')

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected