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
92
93
94
95
96
97
import json
import pytest
from unify_api.tests.constants_t import post_request
class TestListPoint(object):
url = "/unify-api/common/list-point/list-point"
@pytest.mark.parametrize('data', [
{"cid": 117}, {"cid": 118}, {"cid": 44}, {"cid": -100000}
])
@pytest.mark.asyncio
async def test_list_point_true(self, data):
resp_str, status = await post_request(self.url, data)
assert status == 200
resp_dict = json.loads(resp_str)
assert ("inlines" in resp_dict["data"]) is True
@pytest.mark.parametrize('data', [{"cid": "117"}, {"cid": ""}])
@pytest.mark.asyncio
async def test_list_tsp_point_false(self, data):
resp_str, status = await post_request(self.url, data)
assert status == 400
@pytest.mark.parametrize('data', [
{
"cid": 118,
},
])
@pytest.mark.asyncio
async def test_list_storey(data):
"""
获取监测点,进线列表
"""
url = "/unify-api/common/list-point/list-storey"
resp_str, status = await post_request(url, data)
assert status == 200
resp_str = json.loads(resp_str)
assert len(resp_str["data"]["storey_list"]) == 0
@pytest.mark.parametrize('data', [
{
"cid": 118,
}, {
"cid": 44,
},
])
@pytest.mark.asyncio
async def test_list_point_level(data):
"""
获取监测点,进线列表
"""
url = "/unify-api/common/list-point/list-point-level"
resp_str, status = await post_request(url, data)
assert status == 200
resp_str = json.loads(resp_str)
assert resp_str["data"]["power_show_all"]
@pytest.mark.parametrize('data', [
{
"cid": 118,
},
])
@pytest.mark.asyncio
async def test_list_point_inline(data):
"""
获取监测点,进线列表
"""
url = "/unify-api/common/list-point/list-point-inline"
resp_str, status = await post_request(url, data)
assert status == 200
resp_str = json.loads(resp_str)
assert resp_str["data"]["inlines"][0]["inline_id"]
class TestListTspPoint(object):
url = "/unify-api/common/list-point/list-tsp-point"
@pytest.mark.parametrize('data', [
{"cid": 117}, {"cid": 100000}, {"cid": -100000}
])
@pytest.mark.asyncio
async def test_list_tsp_point_true(self, data):
resp_str, status = await post_request(self.url, data)
assert status == 200
resp_dict = json.loads(resp_str)
assert ("tsp_list" in resp_dict["data"]) is True
@pytest.mark.parametrize('data', [{"cid": "117"}, {"cid": ""}])
@pytest.mark.asyncio
async def test_list_tsp_point_false(self, data):
resp_str, status = await post_request(self.url, data)
assert status == 400