forked from Francis-Ju/api4code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
81 lines (71 loc) · 1.45 KB
/
constants.py
File metadata and controls
81 lines (71 loc) · 1.45 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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 脚本功能:全部变量
import sys
import time
import os
# reload(sys)
# sys.setdefaultencoding('utf8')
TEST_URL = 'https://vmsul-service-test.tezign.com'
OUT_PATH = os.path.dirname(os.path.dirname(__file__))
REPORT_NAME = '测试报告'
TITLE = '所有数据准备SQL'
METHOD = 'method'
URL = 'url'
DATA = 'data'
NAME = 'name'
NUMBER = 'number'
CODE = 'code'
HEADERS = 'headers'
REPORT = 'report'
R_NAME = 'reportName'
REPORT_PATH = os.path.join(OUT_PATH,"api4code","report","docs/")
YML_REPORT = os.path.join(OUT_PATH,"api4code","report","mkdocs.yml")
CASE_PATH = os.path.join(OUT_PATH,"api4code","case/")
# 测试报告内容
API_TEST_FAIL = """
```
%s Case Fail
Number: %s
Method: %s
Url: %s
Headers:
%s
Data :
%s
期望值 : %s
实际值 : %s
```
"""
API_TEST_SUCCESS = """
```
%s Case Pass
Number: %s
Method: %s
Url: %s
Headers:
%s
Data :
%s
期望值 : %s
实际值 : %s
```
"""
# 报告结果统计
RESULT_CONTENT = """
测试结果如下:
<table border="3" width="500px">
<tr>
<th style="color: #787878">All</th>
<th style="color: #3cc8b4">Pass</th>
<th style="color: #FFB5C5">Fail</th>
</tr>
<tr>
<th style="color: #787878">%s</th>
<th style="color: #3cc8b4">%s</th>
<th style="color: #FFB5C5">%s</th>
</tr>
</table>
"""
NOW = '_' + time.strftime('%Y%m%d', time.localtime(time.time())) + '.md'
PROJECT_TIME = time.strftime('%Y%m%d', time.localtime(time.time()))