import sys import unittest from numint.riemann_sum import split, numint_epsilon, numint_compact, numint_section Epsilon = 0.0001 class RiemannSumTestCase(unittest.TestCase): """ TODO (Aufgabe) Schreiben Sie Kriterien in Unittest Die Kriterien sind solche Befehlen mit self.assertXXXX """ def test_split_interval(self): split(iteration=6) def test_numint_epsilon(self): def fn(x) : return x**2 (a, b) = (0, 2) (x, y, l, r, n) = numint_epsilon(fn, a, b) print(l, r) # print Take too much place on screen pass def test_numint_section(self): def fn(x) : return x**2 (a, b) = (0, 2) (x, y, l, r, n) = numint_section(fn, a, b, section_count=8) print(l, r) def test_numint_compact(self): def fn(x) : return x**2 (a, b) = (0, 2) (l, r) = numint_compact(fn, a, b, epsilon=1E9 * sys.float_info.epsilon) print(l, r) pass def genauigkeit(self): expeted = 12.3456 result = calculate_complex_fun(...) self.assertTrue(abs(expeted - result) < Epsilon) if __name__ == '__main__': unittest.main()