summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2010-05-23 22:02:08 +0000
committerCharles Harris <charlesr.harris@gmail.com>2010-05-23 22:02:08 +0000
commit6e77005137eca1e7fdd4ebd3935f7f57d6aba7bd (patch)
treee5845447e506a080d00961f5e0a3dfc3e40d8c8a /numpy/polynomial/tests
parent59fd4c37d75895ca09f5ad06571d67084eb34324 (diff)
downloadnumpy-6e77005137eca1e7fdd4ebd3935f7f57d6aba7bd.tar.gz
REV: Revert the changes to the truncate method of Polynomial and Chebyshev.
On second thought it was a bad idea to make such a radical change to existing behaviour. It was also hard to document the variations ;)
Diffstat (limited to 'numpy/polynomial/tests')
-rw-r--r--numpy/polynomial/tests/test_chebyshev.py8
-rw-r--r--numpy/polynomial/tests/test_polynomial.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py
index 2278ca871..d61e8b07c 100644
--- a/numpy/polynomial/tests/test_chebyshev.py
+++ b/numpy/polynomial/tests/test_chebyshev.py
@@ -420,11 +420,11 @@ class TestChebyshevClass(TestCase) :
def test_truncate(self) :
assert_raises(ValueError, self.p1.truncate, .5)
- assert_raises(ValueError, self.p1.truncate, -1)
+ assert_raises(ValueError, self.p1.truncate, 0)
+ assert_equal(len(self.p1.truncate(4)), 3)
assert_equal(len(self.p1.truncate(3)), 3)
- assert_equal(len(self.p1.truncate(2)), 3)
- assert_equal(len(self.p1.truncate(1)), 2)
- assert_equal(len(self.p1.truncate(0)), 1)
+ assert_equal(len(self.p1.truncate(2)), 2)
+ assert_equal(len(self.p1.truncate(1)), 1)
def test_copy(self) :
p = self.p1.copy()
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
index 13718fe9e..530e5d949 100644
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -391,11 +391,11 @@ class TestPolynomialClass(TestCase) :
def test_truncate(self) :
assert_raises(ValueError, self.p1.truncate, .5)
- assert_raises(ValueError, self.p1.truncate, -1)
+ assert_raises(ValueError, self.p1.truncate, 0)
+ assert_equal(len(self.p1.truncate(4)), 3)
assert_equal(len(self.p1.truncate(3)), 3)
- assert_equal(len(self.p1.truncate(2)), 3)
- assert_equal(len(self.p1.truncate(1)), 2)
- assert_equal(len(self.p1.truncate(0)), 1)
+ assert_equal(len(self.p1.truncate(2)), 2)
+ assert_equal(len(self.p1.truncate(1)), 1)
def test_copy(self) :
p = self.p1.copy()