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

Method test_join

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

Source from the content-addressed store, hash-verified

425 assert_(T[2, 0] == b'123 345 \0')
426
427 def test_join(self):
428 # NOTE: list(b'123') == [49, 50, 51]
429 # so that b','.join(b'123') results to an error on Py3
430 A0 = self.A().decode('ascii')
431
432 A = np.char.join([',', '#'], A0)
433 assert_(issubclass(A.dtype.type, np.str_))
434 tgt = np.array([[' ,a,b,c, ', ''],
435 ['1,2,3,4,5', 'M#i#x#e#d#C#a#s#e'],
436 ['1,2,3, ,\t, ,3,4,5, ,\x00, ', 'U#P#P#E#R']])
437 assert_array_equal(np.char.join([',', '#'], A0), tgt)
438
439 def test_ljust(self):
440 A = self.A()

Callers

nothing calls this directly

Calls 5

AMethod · 0.95
assert_Function · 0.90
assert_array_equalFunction · 0.90
decodeMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected