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

Method test_rjust

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

Source from the content-addressed store, hash-verified

551 assert_array_equal(r3, np.array(['X,X,X', 'X,0', 'X']))
552
553 def test_rjust(self):
554 A = self.A()
555 assert_(issubclass(A.rjust(10).dtype.type, np.bytes_))
556
557 C = A.rjust([10, 20])
558 assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]])
559
560 C = A.rjust(20, b'#')
561 assert_(np.all(C.startswith(b'#')))
562 assert_array_equal(C.endswith(b'#'),
563 [[False, True], [False, False], [False, False]])
564
565 C = np.char.rjust(b'FOO', [[10, 20], [15, 8]])
566 tgt = [[b' FOO', b' FOO'],
567 [b' FOO', b' FOO']]
568 assert_(issubclass(C.dtype.type, np.bytes_))
569 assert_array_equal(C, tgt)
570
571 def test_rpartition(self):
572 A = self.A()

Callers

nothing calls this directly

Calls 7

AMethod · 0.95
assert_Function · 0.90
assert_array_equalFunction · 0.90
rjustMethod · 0.80
startswithMethod · 0.80
endswithMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected