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

Method test_rstrip

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

Source from the content-addressed store, hash-verified

586 assert_equal(A.tolist(), tgt)
587
588 def test_rstrip(self):
589 A, B = self.A(), self.B()
590 assert_(issubclass(A.rstrip().dtype.type, np.bytes_))
591
592 tgt = [[b' abc', b''],
593 [b'12345', b'MixedCase'],
594 [b'123 \t 345', b'UPPER']]
595 assert_array_equal(A.rstrip(), tgt)
596
597 tgt = [[b' abc ', b''],
598 [b'1234', b'MixedCase'],
599 [b'123 \t 345 \x00', b'UPP']
600 ]
601 assert_array_equal(A.rstrip([b'5', b'ER']), tgt)
602
603 tgt = [[' \u03a3', ''],
604 ['12345', 'MixedCase'],
605 ['123 \t 345', 'UPPER']]
606 assert_(issubclass(B.rstrip().dtype.type, np.str_))
607 assert_array_equal(B.rstrip(), tgt)
608
609 def test_strip(self):
610 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
rstripMethod · 0.80

Tested by

no test coverage detected