[python-hdf5storage] 75/152: Split previously 2d array write readback test into 1d, 2d, and 3d cases.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 0.1
in repository python-hdf5storage.

commit 7fc2be1e17496b49bb6ae8f07a5ab088d2a6cf21
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sun Feb 2 00:18:04 2014 -0500

    Split previously 2d array write readback test into 1d, 2d, and 3d cases.
---
 tests/test_write_readback.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tests/test_write_readback.py b/tests/test_write_readback.py
index 036bea8..8781651 100644
--- a/tests/test_write_readback.py
+++ b/tests/test_write_readback.py
@@ -234,8 +234,8 @@ class TestPythonMatlabFormat(object):
                                   self.options)
         self.assert_equal_numpy(out, data)
 
-    def check_numpy_array(self, dtype):
-        shape = self.random_numpy_shape(2, 12)
+    def check_numpy_array(self, dtype, dimensions):
+        shape = self.random_numpy_shape(dimensions, 12)
         data = self.random_numpy(shape, dtype)
         out = self.write_readback(data, self.random_name(),
                                   self.options)
@@ -251,12 +251,24 @@ class TestPythonMatlabFormat(object):
         for dt in self.dtypes:
             yield self.check_numpy_scalar, dt
 
-    def test_numpy_array(self):
+    def test_numpy_array_1d(self):
         dtypes = self.dtypes.copy()
         dtypes.append('object')
         for dt in dtypes:
-            yield self.check_numpy_array, dt
+            yield self.check_numpy_array, dt, 1
 
+    def test_numpy_array_2d(self):
+        dtypes = self.dtypes.copy()
+        dtypes.append('object')
+        for dt in dtypes:
+            yield self.check_numpy_array, dt, 2
+
+    def test_numpy_array_3d(self):
+        dtypes = self.dtypes.copy()
+        dtypes.append('object')
+        for dt in dtypes:
+            yield self.check_numpy_array, dt, 3
+    
     def test_numpy_empty(self):
         for dt in self.dtypes:
             yield self.check_numpy_empty, dt

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-hdf5storage.git



More information about the debian-science-commits mailing list