diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-07-13 21:47:43 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-07-13 21:47:43 +0000 |
commit | 382db3569b1cccee5b4e813919dced51d8352a97 (patch) | |
tree | b7f55b050de8840768fef052bbeb17d8b415e9f6 /numpy/lib/tests/test_index_tricks.py | |
parent | da2a99485f401a0b09b6fe47ec1f23190d0259bf (diff) | |
download | numpy-382db3569b1cccee5b4e813919dced51d8352a97.tar.gz |
Added tests to improve coverage.
Renamed TestPiecewise methods so that they will be picked up by nose.
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r-- | numpy/lib/tests/test_index_tricks.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py index 1020d4f82..3cfed1059 100644 --- a/numpy/lib/tests/test_index_tricks.py +++ b/numpy/lib/tests/test_index_tricks.py @@ -1,5 +1,12 @@ from numpy.testing import * -from numpy import array, ones, r_, mgrid +from numpy import array, ones, r_, mgrid, unravel_index + +class TestUnravelIndex(TestCase): + def test_basic(self): + assert unravel_index(2,(2,2)) == (1,0) + assert unravel_index(254,(17,94)) == (2, 66) + assert_raises(ValueError, unravel_index, 4,(2,2)) + class TestGrid(TestCase): def test_basic(self): @@ -26,6 +33,7 @@ class TestGrid(TestCase): assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11) assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11) + class TestConcatenator(TestCase): def test_1d(self): assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6])) |