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

Method test_ljust

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

Source from the content-addressed store, hash-verified

437 assert_array_equal(np.char.join([',', '#'], A0), tgt)
438
439 def test_ljust(self):
440 A = self.A()
441 assert_(issubclass(A.ljust(10).dtype.type, np.bytes_))
442
443 C = A.ljust([10, 20])
444 assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]])
445
446 C = A.ljust(20, b'#')
447 assert_array_equal(C.startswith(b'#'), [
448 [False, True], [False, False], [False, False]])
449 assert_(np.all(C.endswith(b'#')))
450
451 C = np.char.ljust(b'FOO', [[10, 20], [15, 8]])
452 tgt = [[b'FOO ', b'FOO '],
453 [b'FOO ', b'FOO ']]
454 assert_(issubclass(C.dtype.type, np.bytes_))
455 assert_array_equal(C, tgt)
456
457 def test_lower(self):
458 A, B = self.A(), self.B()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected