| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 | | 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() | 
 |