From 6e77005137eca1e7fdd4ebd3935f7f57d6aba7bd Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 23 May 2010 22:02:08 +0000 Subject: 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 ;) --- numpy/polynomial/tests/test_chebyshev.py | 8 ++++---- numpy/polynomial/tests/test_polynomial.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'numpy/polynomial/tests') 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() -- cgit v1.2.1