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

Method test_ljust

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

Source from the content-addressed store, hash-verified

371 assert_array_equal(np.char.join([',', '#'], A0), tgt)
372
373 def test_ljust(self):
374 assert_(issubclass(self.A.ljust(10).dtype.type, np.bytes_))
375
376 C = self.A.ljust([10, 20])
377 assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]])
378
379 C = self.A.ljust(20, b'#')
380 assert_array_equal(C.startswith(b'#'), [
381 [False, True], [False, False], [False, False]])
382 assert_(np.all(C.endswith(b'#')))
383
384 C = np.char.ljust(b'FOO', [[10, 20], [15, 8]])
385 tgt = [[b'FOO ', b'FOO '],
386 [b'FOO ', b'FOO ']]
387 assert_(issubclass(C.dtype.type, np.bytes_))
388 assert_array_equal(C, tgt)
389
390 def test_lower(self):
391 tgt = [[b' abc ', b''],

Callers

nothing calls this directly

Calls 6

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