diff options
Diffstat (limited to 'test/test_function.py')
-rw-r--r-- | test/test_function.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_function.py b/test/test_function.py index da3d851..933fd2e 100644 --- a/test/test_function.py +++ b/test/test_function.py @@ -216,8 +216,7 @@ def test_df(): assert_array_almost_equal(xp, xp_expected, decimal=16) assert_array_almost_equal(yp, yp_expected, decimal=16) - avrg_expected = 2.0 / 5.0 - assert_almost_equal(f.avrg(), avrg_expected, decimal=16) + assert_almost_equal(f.avrg(), 2.0/5.0, decimal=16) # interval averaging a = f.avrg([0.5, 2.4]) @@ -229,6 +228,10 @@ def test_df(): a = f.avrg([1.1, 4.0]) assert_almost_equal(a, 1.0/3.0, decimal=16) + # averaging over multiple intervals + a = f.avrg([(0.5, 1.5), (1.5, 2.6)]) + assert_almost_equal(a, 2.0/5.0, decimal=16) + if __name__ == "__main__": test_pwc() |