|
@@ -6,7 +6,6 @@ import json
|
6
|
6
|
from pyheatpump.heatpump import app
|
7
|
7
|
|
8
|
8
|
|
9
|
|
-@pytest.mark.skip
|
10
|
9
|
def test_get_(set_test_db):
|
11
|
10
|
c = TestClient(app)
|
12
|
11
|
r = c.get('/')
|
|
@@ -27,6 +26,7 @@ def test_dict(set_test_db):
|
27
|
26
|
resp = r.content.decode()
|
28
|
27
|
assert isinstance(resp, str)
|
29
|
28
|
|
|
29
|
+ print(resp)
|
30
|
30
|
d_resp = json.loads(resp)
|
31
|
31
|
assert isinstance(d_resp, dict)
|
32
|
32
|
print(d_resp)
|
|
@@ -35,11 +35,28 @@ def test_dict(set_test_db):
|
35
|
35
|
assert isinstance(d_resp['macAddress'], str)
|
36
|
36
|
assert 'Analog' in d_resp.keys()
|
37
|
37
|
assert isinstance(d_resp['Analog'], dict)
|
|
38
|
+ int_keys = list(map(int, d_resp['Analog'].keys()))
|
|
39
|
+ assert min(int_keys) == 10
|
|
40
|
+ assert max(int_keys) == 17
|
|
41
|
+ assert d_resp['Analog']['10'] == 4.2
|
|
42
|
+ assert d_resp['Analog']['17'] == -2953.6
|
|
43
|
+
|
38
|
44
|
assert 'Digital' in d_resp.keys()
|
39
|
45
|
assert isinstance(d_resp['Digital'], dict)
|
|
46
|
+ int_keys = list(map(int, d_resp['Digital'].keys()))
|
|
47
|
+ assert min(int_keys) == 10
|
|
48
|
+ assert max(int_keys) == 14
|
|
49
|
+
|
|
50
|
+ assert d_resp['Digital']['10'] == False
|
|
51
|
+ assert d_resp['Digital']['14'] == True
|
|
52
|
+
|
40
|
53
|
assert 'Integer' in d_resp.keys()
|
41
|
54
|
assert isinstance(d_resp['Integer'], dict)
|
42
|
55
|
int_keys = list(map(int, d_resp['Integer'].keys()))
|
|
56
|
+ print(int_keys)
|
43
|
57
|
assert min(int_keys) == 1
|
44
|
|
- assert max(int_keys) == 2
|
|
58
|
+ assert max(int_keys) == 10
|
|
59
|
+
|
|
60
|
+ assert d_resp['Integer']['1'] == 101
|
|
61
|
+ assert d_resp['Integer']['10'] == 24
|
45
|
62
|
|