diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-05-21 05:36:05 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-05-21 05:36:05 +0000 |
commit | af79cde3ecc5a7bf6b14c97698cad08f2bde82b8 (patch) | |
tree | a833e7b4b3b938e2a5d197589a5ac89d3a836225 /numpy/polynomial/tests/test_polynomial.py | |
parent | ee4a8d391e21fe41ba919b21e890348c64b5a0e7 (diff) | |
download | numpy-af79cde3ecc5a7bf6b14c97698cad08f2bde82b8.tar.gz |
CHG: Change the truncate method of the Chebyshev and Polynomial classes
to take degree instead of length. This seems to fit better with normal
usage. I feel this change is safe at this time because these new classes
seem to be little used as yet.
Diffstat (limited to 'numpy/polynomial/tests/test_polynomial.py')
-rw-r--r-- | numpy/polynomial/tests/test_polynomial.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py index 34a3d10f3..7ba5b6c8f 100644 --- a/numpy/polynomial/tests/test_polynomial.py +++ b/numpy/polynomial/tests/test_polynomial.py @@ -390,11 +390,12 @@ class TestPolynomialClass(TestCase) : assert_equal(p.trim(1e-5).coef, coef[:1]) def test_truncate(self) : - assert_raises(ValueError, self.p1.truncate, 0) - assert_equal(len(self.p1.truncate(4)), 3) + assert_raises(ValueError, self.p1.truncate, .5) + assert_raises(ValueError, self.p1.truncate, -1) assert_equal(len(self.p1.truncate(3)), 3) - assert_equal(len(self.p1.truncate(2)), 2) - assert_equal(len(self.p1.truncate(1)), 1) + assert_equal(len(self.p1.truncate(2)), 3) + assert_equal(len(self.p1.truncate(1)), 2) + assert_equal(len(self.p1.truncate(0)), 1) def test_copy(self) : p = self.p1.copy() |