-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest_card.py
More file actions
91 lines (88 loc) · 2.11 KB
/
test_card.py
File metadata and controls
91 lines (88 loc) · 2.11 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import pytest
from notecard import card
@pytest.mark.parametrize(
'fluent_api,notecard_api,req_params',
[
(
card.attn,
'card.attn',
{
'mode': 'arm',
'files': ['data.qi', 'my-settings.db'],
'seconds': 60,
'payload': 'ewogICJpbnRlcnZhbHMiOiI2MCwxMiwxNCIKfQ==',
'start': True
}
),
(
card.status,
'card.status',
{}
),
(
card.time,
'card.time',
{}
),
(
card.temp,
'card.temp',
{'minutes': 5}
),
(
card.version,
'card.version',
{}
),
(
card.voltage,
'card.voltage',
{
'hours': 1,
'offset': 2,
'vmax': 1.1,
'vmin': 1.2
}
),
(
card.voltage,
'card.voltage',
{
'usb': True
}
),
(
card.voltage,
'card.voltage',
{
'alert': True
}
),
(
card.voltage,
'card.voltage',
{
'usb': True,
'alert': True
}
),
(
card.wireless,
'card.wireless',
{
'mode': 'auto',
'apn': 'myapn.nb'
}
)
]
)
class TestCard:
def test_fluent_api_maps_notecard_api_correctly(
self, fluent_api, notecard_api, req_params,
run_fluent_api_notecard_api_mapping_test):
run_fluent_api_notecard_api_mapping_test(fluent_api, notecard_api,
req_params)
def test_fluent_api_fails_with_invalid_notecard(
self, fluent_api, notecard_api, req_params,
run_fluent_api_invalid_notecard_test):
run_fluent_api_invalid_notecard_test(fluent_api, req_params)