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

Method test_gft_from_gzip

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

Source from the content-addressed store, hash-verified

2384 assert_array_equal(res, tgt)
2385
2386 def test_gft_from_gzip(self):
2387 # Test that we can load data from a gzipped file
2388 wanted = np.arange(6).reshape((2, 3))
2389 linesep = ('\n', '\r\n', '\r')
2390
2391 for sep in linesep:
2392 data = '0 1 2' + sep + '3 4 5'
2393 s = BytesIO()
2394 with gzip.GzipFile(fileobj=s, mode='w') as g:
2395 g.write(asbytes(data))
2396
2397 with temppath(suffix='.gz2') as name:
2398 with open(name, 'w') as f:
2399 f.write(data)
2400 assert_array_equal(np.genfromtxt(name), wanted)
2401
2402 def test_gft_using_generator(self):
2403 # gft doesn't work with unicode.

Callers

nothing calls this directly

Calls 6

asbytesFunction · 0.90
temppathFunction · 0.90
assert_array_equalFunction · 0.90
openFunction · 0.85
reshapeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected