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

Method test_strip

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

Source from the content-addressed store, hash-verified

489 assert_array_equal(self.B.rstrip(), tgt)
490
491 def test_strip(self):
492 tgt = [[b'abc', b''],
493 [b'12345', b'MixedCase'],
494 [b'123 \t 345', b'UPPER']]
495 assert_(issubclass(self.A.strip().dtype.type, np.bytes_))
496 assert_array_equal(self.A.strip(), tgt)
497
498 tgt = [[b' abc ', b''],
499 [b'234', b'ixedCas'],
500 [b'23 \t 345 \x00', b'UPP']]
501 assert_array_equal(self.A.strip([b'15', b'EReM']), tgt)
502
503 tgt = [['\u03a3', ''],
504 ['12345', 'MixedCase'],
505 ['123 \t 345', 'UPPER']]
506 assert_(issubclass(self.B.strip().dtype.type, np.str_))
507 assert_array_equal(self.B.strip(), tgt)
508
509 def test_split(self):
510 A = self.A.split(b'3')

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_array_equalFunction · 0.90
stripMethod · 0.80

Tested by

no test coverage detected