tests.test_comparisons   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 32
dl 0
loc 46
rs 10
c 0
b 0
f 0

7 Functions

Rating   Name   Duplication   Size   Complexity  
A test_greater_than_or_equal() 0 5 1
A test_equal() 0 4 1
A test_less_than() 0 4 1
A test_no_op() 0 3 1
A test_greater_than() 0 4 1
A test_less_than_or_equal() 0 5 1
A test_not_equal() 0 4 1
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