summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authornjsmith <njs@pobox.com>2012-09-11 11:07:32 -0700
committernjsmith <njs@pobox.com>2012-09-11 11:07:32 -0700
commitaed8fc547bfac6f3d9248e65a53e3eae6393a715 (patch)
treebcb8c82703bbebdb789746a2a8b5622c9a2185ae /numpy/lib/tests
parentb6a1acdd6c989e6e2ab6d68f1b60af030bcccc49 (diff)
parent1688b29fb1ea4e548762ae79522c50abce88d55b (diff)
downloadnumpy-aed8fc547bfac6f3d9248e65a53e3eae6393a715.tar.gz
Merge pull request #429 from 87/fix_insert
Fix for issues #392 and #378
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_function_base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 7c1b01345..da3eb2b84 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -147,6 +147,15 @@ class TestInsert(TestCase):
assert_equal(insert(a, [1, 1, 1], [1, 2, 3]), [1, 1, 2, 3, 2, 3])
assert_equal(insert(a, 1,[1,2,3]), [1, 1, 2, 3, 2, 3])
assert_equal(insert(a,[1,2,3],9),[1,9,2,9,3,9])
+ b = np.array([0, 1], dtype=np.float64)
+ assert_equal(insert(b, 0, b[0]), [0., 0., 1.])
+ def test_multidim(self):
+ a = [[1, 1, 1]]
+ r = [[2, 2, 2],
+ [1, 1, 1]]
+ assert_equal(insert(a, 0, [2, 2, 2], axis=0), r)
+ assert_equal(insert(a, 0, 2, axis=0), r)
+ assert_equal(insert(a, 2, 2, axis=1), [[1, 1, 2, 1]])
class TestAmax(TestCase):
def test_basic(self):