summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2009-02-22 13:48:21 +0000
committerStefan van der Walt <stefan@sun.ac.za>2009-02-22 13:48:21 +0000
commit34f564a48d8530dc21fe59c13d35879fd6808bf7 (patch)
tree7d6b703f58d857d7dd6f8a53012789dff11060f2 /numpy/lib/tests/test_io.py
parentce06f48088eead408ff2e4fee07b9eb555106b4b (diff)
downloadnumpy-34f564a48d8530dc21fe59c13d35879fd6808bf7.tar.gz
Add test for Gzip loader.
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 25309316e..f545bfe34 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -805,7 +805,21 @@ M 33 21.99
self.failUnless(isinstance(test, np.recarray))
assert_equal(test, control)
+def test_gzip_load():
+ import gzip
+ from StringIO import StringIO
+ a = np.random.random((5, 5))
+
+ s = StringIO()
+ f = gzip.GzipFile(fileobj=s, mode="w")
+
+ np.save(f, a)
+ f.close()
+ s.seek(0)
+
+ f = gzip.GzipFile(fileobj=s, mode="r")
+ assert_array_equal(np.load(f), a)
if __name__ == "__main__":