[Numpy-svn] r4979 - trunk/numpy/testing/tests
numpy-svn at scipy.org
numpy-svn at scipy.org
Mon Apr 7 19:18:49 EDT 2008
Author: cdavid
Date: 2008-04-07 18:18:47 -0500 (Mon, 07 Apr 2008)
New Revision: 4979
Modified:
trunk/numpy/testing/tests/test_utils.py
Log:
Some more tests for assert_* functions.
Modified: trunk/numpy/testing/tests/test_utils.py
===================================================================
--- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:18:32 UTC (rev 4978)
+++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:18:47 UTC (rev 4979)
@@ -17,14 +17,41 @@
raise AssertionError("a and b are found equal but are not")
def test_array_rank1_eq(self):
- """Test two equal array are found equal."""
+ """Test two equal array of rank 1 are found equal."""
a = N.array([1, 2])
b = N.array([1, 2])
self._test_equal(a, b)
def test_array_rank1_noteq(self):
+ """Test two different array of rank 1 are found not equal."""
a = N.array([1, 2])
b = N.array([2, 2])
self._test_not_equal(a, b)
+
+ def test_array_rank2_eq(self):
+ """Test two equal array of rank 2 are found equal."""
+ a = N.array([[1, 2], [3, 4]])
+ b = N.array([[1, 2], [3, 4]])
+
+ self._test_equal(a, b)
+
+ def test_array_diffshape(self):
+ """Test two arrays with different shapes are found not equal."""
+ a = N.array([1, 2])
+ b = N.array([[1, 2], [1, 2]])
+
+ self._test_not_equal(a, b)
+
+ def test_string_arrays(self):
+ """Test two arrays with different shapes are found not equal."""
+ a = N.array(['floupi', 'floupa'])
+ b = N.array(['floupi', 'floupa'])
+
+ self._test_equal(a, b)
+
+ c = N.array(['floupipi', 'floupa'])
+
+ self._test_not_equal(c, b)
+
More information about the Numpy-svn
mailing list