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

Method test_join

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

Source from the content-addressed store, hash-verified

359 assert_(T[2, 0] == b'123 345 \0')
360
361 def test_join(self):
362 # NOTE: list(b'123') == [49, 50, 51]
363 # so that b','.join(b'123') results to an error on Py3
364 A0 = self.A.decode('ascii')
365
366 A = np.char.join([',', '#'], A0)
367 assert_(issubclass(A.dtype.type, np.str_))
368 tgt = np.array([[' ,a,b,c, ', ''],
369 ['1,2,3,4,5', 'M#i#x#e#d#C#a#s#e'],
370 ['1,2,3, ,\t, ,3,4,5, ,\x00, ', 'U#P#P#E#R']])
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_))

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
assert_array_equalFunction · 0.90
decodeMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected