MCPcopy
hub / github.com/numpy/numpy / test_converters_decode

Method test_converters_decode

numpy/lib/tests/test_io.py:706–714  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

704 assert_array_equal(v, np.array(utf16.decode('UTF-16').split()))
705
706 def test_converters_decode(self):
707 # test converters that decode strings
708 c = TextIO()
709 c.write(b'\xcf\x96')
710 c.seek(0)
711 x = self.loadfunc(c, dtype=np.str_, encoding="bytes",
712 converters={0: lambda x: x.decode('UTF-8')})
713 a = np.array([b'\xcf\x96'.decode('UTF-8')])
714 assert_array_equal(x, a)
715
716 def test_converters_nodecode(self):
717 # test native string converters enabled by setting an encoding

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
assert_array_equalFunction · 0.90
TextIOClass · 0.85
seekMethod · 0.80
decodeMethod · 0.80

Tested by

no test coverage detected