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

Method test_rstrip

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

Source from the content-addressed store, hash-verified

469 assert_equal(A.tolist(), tgt)
470
471 def test_rstrip(self):
472 assert_(issubclass(self.A.rstrip().dtype.type, np.bytes_))
473
474 tgt = [[b' abc', b''],
475 [b'12345', b'MixedCase'],
476 [b'123 \t 345', b'UPPER']]
477 assert_array_equal(self.A.rstrip(), tgt)
478
479 tgt = [[b' abc ', b''],
480 [b'1234', b'MixedCase'],
481 [b'123 \t 345 \x00', b'UPP']
482 ]
483 assert_array_equal(self.A.rstrip([b'5', b'ER']), tgt)
484
485 tgt = [[' \u03a3', ''],
486 ['12345', 'MixedCase'],
487 ['123 \t 345', 'UPPER']]
488 assert_(issubclass(self.B.rstrip().dtype.type, np.str_))
489 assert_array_equal(self.B.rstrip(), tgt)
490
491 def test_strip(self):
492 tgt = [[b'abc', b''],

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_array_equalFunction · 0.90
rstripMethod · 0.80

Tested by

no test coverage detected