diff options
author | Wendell Smith <wendellwsmith@gmail.com> | 2014-11-18 12:22:29 -0500 |
---|---|---|
committer | Wendell Smith <wendellwsmith@gmail.com> | 2014-11-18 14:16:06 -0500 |
commit | be13b6a92df20bb0fefb29075861ba6a536ae32b (patch) | |
tree | 81d3c2dff3070df8b90228db6f51861bd44296dc /numpy/lib/tests/test_io.py | |
parent | 60de33d58f6d1a4f70ebf5af22e8873a36cd3be2 (diff) | |
download | numpy-be13b6a92df20bb0fefb29075861ba6a536ae32b.tar.gz |
TEST: added test of BagObj
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 4038d6a7f..68b2018cd 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -216,6 +216,17 @@ class TestSavezLoad(RoundtripTest, TestCase): l = np.load(c) assert_equal(a, l['file_a']) assert_equal(b, l['file_b']) + + def test_BagObj(self): + a = np.array([[1, 2], [3, 4]], float) + b = np.array([[1 + 2j, 2 + 7j], [3 - 6j, 4 + 12j]], complex) + c = BytesIO() + np.savez(c, file_a=a, file_b=b) + c.seek(0) + l = np.load(c) + assert_equal(sorted(dir(l.f)), ['file_a','file_b']) + assert_equal(a, l.f.file_a) + assert_equal(b, l.f.file_b) def test_savez_filename_clashes(self): # Test that issue #852 is fixed |