diff options
Diffstat (limited to 'numpy/polynomial/tests')
-rw-r--r-- | numpy/polynomial/tests/test_chebyshev.py | 8 | ||||
-rw-r--r-- | numpy/polynomial/tests/test_polynomial.py | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py index d61e8b07c..5662d0362 100644 --- a/numpy/polynomial/tests/test_chebyshev.py +++ b/numpy/polynomial/tests/test_chebyshev.py @@ -402,6 +402,14 @@ class TestChebyshevClass(TestCase) : def test_degree(self) : assert_equal(self.p1.degree(), 2) + def test_reduce(self) : + assert_raises(ValueError, self.p1.reduce, .5) + assert_raises(ValueError, self.p1.reduce, -1) + assert_equal(len(self.p1.reduce(3)), 3) + assert_equal(len(self.p1.reduce(2)), 3) + assert_equal(len(self.p1.reduce(1)), 2) + assert_equal(len(self.p1.reduce(0)), 1) + def test_convert(self) : x = np.linspace(-1,1) p = self.p1.convert(domain=[0,1]) diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py index 530e5d949..15525fcd8 100644 --- a/numpy/polynomial/tests/test_polynomial.py +++ b/numpy/polynomial/tests/test_polynomial.py @@ -373,6 +373,14 @@ class TestPolynomialClass(TestCase) : def test_degree(self) : assert_equal(self.p1.degree(), 2) + def test_reduce(self) : + assert_raises(ValueError, self.p1.reduce, .5) + assert_raises(ValueError, self.p1.reduce, -1) + assert_equal(len(self.p1.reduce(3)), 3) + assert_equal(len(self.p1.reduce(2)), 3) + assert_equal(len(self.p1.reduce(1)), 2) + assert_equal(len(self.p1.reduce(0)), 1) + def test_convert(self) : x = np.linspace(-1,1) p = self.p1.convert(domain=[0,1]) |