Skip to content

Commit 24a4f34

Browse files
committed
添加allure部分、
1 parent 7ee3c3e commit 24a4f34

196 files changed

Lines changed: 204 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/train_get.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ def train_get(self, path_dict):
1414
response.encoding = 'utf-8'
1515
return response
1616

17-
17+
if __name__ == '__main__':
18+
train = Train()
19+
print(train.url)
1820

core/rest_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self):
1818
self.env_dict = Env('us')
1919

2020
self.session = requests.session()
21-
self.header = self.env_dict.env_dicts['header']
21+
# self.header = self.env_dict.env_dicts['header']
2222
self.api_root_url = self.env_dict.env_dicts['api_root_url']
2323
self.data = None # 用来存储请求的参数
2424
self.news = ''
@@ -27,6 +27,7 @@ def get(self, url, **kwargs):
2727
url = self.api_root_url + url
2828
self.url = url
2929
response = self.session.get(url, **kwargs)
30+
self.header_print = response.headers
3031
try:
3132
self.response_type = 0
3233
self.response_json = response.json()
@@ -49,6 +50,7 @@ def post(self, url, data=None, json=None, **kwargs):
4950
else:
5051
pass
5152
response = self.session.post(url, data, json, **kwargs)
53+
self.header_print = response.headers
5254
try:
5355
self.response_type = 0
5456
self.response_json = response.json()
@@ -78,6 +80,7 @@ def put(self, url, json=None, data=None, **kwargs):
7880
self.data = data
7981
self.data_print = "请求参数" + str(data)
8082
response = self.session.put(url, json=json, **kwargs)
83+
self.header_print = response.headers
8184
try:
8285
self.response_type = 0
8386
self.response_json = response.json()

jpg/result.png

85.4 KB
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name": "test_train_get_tiaoshi[TC-002,正确的数据1]", "status": "passed", "parameters": [{"name": "data_dict", "value": "{}"}, {"name": "path_dict", "value": "{'start': '杭州', 'end': '北京', 'ishigh': 0}"}, {"name": "assert_dict", "value": "{'status_code': 200, '$.status': 101}"}], "start": 1580553408783, "stop": 1580553408815, "uuid": "0800b1cc-a904-4050-b897-d7b6af384e61", "historyId": "4d78a164e9983245a668f8bd5d34fb97", "testCaseId": "5828c23382d17867127a21a999138a13", "fullName": "train.test_train.TestTrain#test_train_get_tiaoshi", "labels": [{"name": "parentSuite", "value": "train"}, {"name": "suite", "value": "test_train"}, {"name": "subSuite", "value": "TestTrain"}, {"name": "host", "value": "WIN-20190720JMH"}, {"name": "thread", "value": "7760-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "train.test_train"}]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"uuid": "1dfae3b9-c8a2-456d-895f-37d2425780d9", "befores": [{"name": "path_dict", "status": "passed", "start": 1580553720300, "stop": 1580553720300}], "start": 1580553720300, "stop": 1580553720369}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"uuid": "f37aa8a5-09b4-4184-a9bc-3a9520e2dcb6", "befores": [{"name": "path_dict", "status": "passed", "start": 1580553719713, "stop": 1580553719713}], "start": 1580553719713, "stop": 1580553720172}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"uuid": "3991555d-ac09-453b-8ca6-c3777eb0f4ce", "befores": [{"name": "assert_dict", "status": "passed", "start": 1580553666423, "stop": 1580553666423}], "start": 1580553666423, "stop": 1580553666510}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"uuid": "15851675-0e8c-4bbd-bd74-758f9fe76103", "befores": [{"name": "path_dict", "status": "passed", "start": 1580553720968, "stop": 1580553720968}], "start": 1580553720968, "stop": 1580553721090}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name": "test_train_get[TC-002,正确的数据10]", "status": "passed", "description": "https://api.jisuapi.com/train/station2s?start=杭州&end=北京&ishight=0\n\n{'Server': 'nginx/1.16.0', 'Date': 'Sat, 01 Feb 2020 10:41:59 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Powered-By': 'PHP/7.1.32', 'Content-Encoding': 'gzip'}\n\n{'status': '101', 'msg': 'APPKEY为空', 'result': ''}", "parameters": [{"name": "data_dict", "value": "{}"}, {"name": "path_dict", "value": "{'start': '杭州', 'end': '北京', 'ishigh': 0}"}, {"name": "assert_dict", "value": "{'status_code': 200, '$.status': 101}"}], "start": 1580553720186, "stop": 1580553720287, "uuid": "4470e007-01c5-4045-86a6-1dbd691f88b8", "historyId": "d8c09e25b059fb5e67bc126c0405d432", "testCaseId": "2b59bd88ae2a2fa2393413e982d8a1fd", "fullName": "train.test_train.TestTrain#test_train_get", "labels": [{"name": "parentSuite", "value": "train"}, {"name": "suite", "value": "test_train"}, {"name": "subSuite", "value": "TestTrain"}, {"name": "host", "value": "WIN-20190720JMH"}, {"name": "thread", "value": "20692-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "train.test_train"}]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"uuid": "029762c0-afbc-437d-91ba-64a911350f58", "befores": [{"name": "assert_dict", "status": "passed", "start": 1580553666659, "stop": 1580553666659}], "start": 1580553666659, "stop": 1580553666744}

0 commit comments

Comments
 (0)