Total Complexity | 7 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from decision_engine.comparisons import GreaterThan, GreaterThanOrEqual, \ |
||
2 | LessThan, LessThanOrEqual, Equal, NotEqual, NoOp |
||
3 | |||
4 | |||
5 | def test_no_op(): |
||
6 | comp = NoOp() |
||
7 | assert comp.check(False, False) |
||
8 | |||
9 | |||
10 | def test_equal(): |
||
11 | comp = Equal() |
||
12 | assert comp.check(10, 10) |
||
13 | assert not comp.check(10, 20) |
||
14 | |||
15 | |||
16 | def test_not_equal(): |
||
17 | comp = NotEqual() |
||
18 | assert comp.check(10, 20) |
||
19 | assert not comp.check(10, 10) |
||
20 | |||
21 | |||
22 | def test_greater_than(): |
||
23 | comp = GreaterThan() |
||
24 | assert comp.check(10, 5) |
||
25 | assert not comp.check(10, 50) |
||
26 | |||
27 | |||
28 | def test_greater_than_or_equal(): |
||
29 | comp = GreaterThanOrEqual() |
||
30 | assert comp.check(10, 5) |
||
31 | assert comp.check(10, 10) |
||
32 | assert not comp.check(10, 50) |
||
33 | |||
34 | |||
35 | def test_less_than(): |
||
36 | comp = LessThan() |
||
37 | assert comp.check(5, 10) |
||
38 | assert not comp.check(50, 10) |
||
39 | |||
40 | |||
41 | def test_less_than_or_equal(): |
||
42 | comp = LessThanOrEqual() |
||
43 | assert comp.check(5, 10) |
||
44 | assert comp.check(5, 5) |
||
45 | assert not comp.check(50, 5) |
||
46 |