forked from coveros-matt-taylor/autoinsurance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
68 lines (54 loc) · 2.71 KB
/
test.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import pytest
from logic import *
cases = [
# claims, age, premium_increase, warning_letter, cancel_policy, error
(0, 15, -1, WarningLetterEnum.NONE, False, True),
(0, 16, 50, WarningLetterEnum.NONE, False, False),
(0, 17, 50, WarningLetterEnum.NONE, False, False),
(0, 25, 50, WarningLetterEnum.NONE, False, False),
(0, 26, 25, WarningLetterEnum.NONE, False, False),
(0, 27, 25, WarningLetterEnum.NONE, False, False),
(0, 84, 25, WarningLetterEnum.NONE, False, False),
(0, 85, 25, WarningLetterEnum.NONE, False, False),
(0, 86, -1, WarningLetterEnum.NONE, False, True),
(1, 15, -1, WarningLetterEnum.NONE, False, True),
(1, 16, 100, WarningLetterEnum.LTR1, False, False),
(1, 17, 100, WarningLetterEnum.LTR1, False, False),
(1, 25, 100, WarningLetterEnum.LTR1, False, False),
(1, 26, 50, WarningLetterEnum.NONE, False, False),
(1, 27, 50, WarningLetterEnum.NONE, False, False),
(1, 84, 50, WarningLetterEnum.NONE, False, False),
(1, 85, 50, WarningLetterEnum.NONE, False, False),
(1, 86, -1, WarningLetterEnum.NONE, False, True),
(2, 15, -1, WarningLetterEnum.NONE, False, True),
(2, 16, 400, WarningLetterEnum.LTR2, False, False),
(2, 17, 400, WarningLetterEnum.LTR2, False, False),
(2, 25, 400, WarningLetterEnum.LTR2, False, False),
(2, 26, 200, WarningLetterEnum.LTR3, False, False),
(2, 27, 200, WarningLetterEnum.LTR3, False, False),
(2, 84, 200, WarningLetterEnum.LTR3, False, False),
(2, 85, 200, WarningLetterEnum.LTR3, False, False),
(2, 86, -1, WarningLetterEnum.NONE, False, True),
(4, 15, -1, WarningLetterEnum.NONE, False, True),
(4, 16, 400, WarningLetterEnum.LTR2, False, False),
(4, 17, 400, WarningLetterEnum.LTR2, False, False),
(4, 25, 400, WarningLetterEnum.LTR2, False, False),
(4, 26, 200, WarningLetterEnum.LTR3, False, False),
(4, 27, 200, WarningLetterEnum.LTR3, False, False),
(4, 84, 200, WarningLetterEnum.LTR3, False, False),
(4, 85, 200, WarningLetterEnum.LTR3, False, False),
(4, 86, -1, WarningLetterEnum.NONE, False, True),
(5, 26, 0, WarningLetterEnum.NONE, True, False),
(6, 26, 0, WarningLetterEnum.NONE, True, False),
(5, 80, 0, WarningLetterEnum.NONE, True, False),
(-1, 80, -1, WarningLetterEnum.NONE, False, True),
]
@pytest.mark.parametrize("data", cases)
def test_thing(data):
result = process(data[0], data[1])
expected = AutoInsuranceAction(data[2], data[3], data[4], data[5])
# expected
assert(expected.premium_increase == result.premium_increase)
assert(expected.warning_letter_enum == result.warning_letter_enum)
assert(expected.is_policy_canceled == result.is_policy_canceled)
assert(expected.is_error == result.is_error)