'Test the first few degrees, for evenly spaced points.'

def test_newton_cotes(self):

    n = 1
    (wts, errcoff) = newton_cotes(n, 1)
    assert_equal(wts, (n * np.array([0.5, 0.5])))
    assert_almost_equal(errcoff, ((- (n ** 3)) / 12.0))
    n = 2
    (wts, errcoff) = newton_cotes(n, 1)
    assert_almost_equal(wts, ((n * np.array([1.0, 4.0, 1.0])) / 6.0))
    assert_almost_equal(errcoff, ((- (n ** 5)) / 2880.0))
    n = 3
    (wts, errcoff) = newton_cotes(n, 1)
    assert_almost_equal(wts, ((n * np.array([1.0, 3.0, 3.0, 1.0])) / 8.0))
    assert_almost_equal(errcoff, ((- (n ** 5)) / 6480.0))
    n = 4
    (wts, errcoff) = newton_cotes(n, 1)
    assert_almost_equal(wts, ((n * np.array([7.0, 32.0, 12.0, 32.0, 7.0])) / 90.0))
    assert_almost_equal(errcoff, ((- (n ** 7)) / 1935360.0))
