forked from wuranxu/pity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
executable file
·114 lines (90 loc) · 2.77 KB
/
config.py
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# 基础配置类
import os
from enum import IntEnum
class Config(object):
ROOT = os.path.dirname(os.path.abspath(__file__))
LOG_DIR = os.path.join(ROOT, 'logs')
LOG_NAME = os.path.join(LOG_DIR, 'pity.log')
# JSON_AS_ASCII = False # Flask jsonify编码问题
# MySQL连接信息
MYSQL_HOST = "121.5.2.74"
MYSQL_PORT = 3306
MYSQL_USER = "root"
MYSQL_PWD = "wuranxu@33"
DBNAME = "pity"
REDIS_HOST = "121.5.2.74"
REDIS_PORT = 7788
REDIS_DB = 0
REDIS_PASSWORD = "woodywu123"
# Redis连接信息
REDIS_NODES = [{"host": REDIS_HOST, "port": REDIS_PORT, "db": REDIS_DB, "password": REDIS_PASSWORD}]
# sqlalchemy
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://{}:{}@{}:{}/{}'.format(
MYSQL_USER, MYSQL_PWD, MYSQL_HOST, MYSQL_PORT, DBNAME)
# 异步URI
ASYNC_SQLALCHEMY_URI = f'mysql+aiomysql://{MYSQL_USER}:{MYSQL_PWD}@{MYSQL_HOST}:{MYSQL_PORT}/{DBNAME}'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# 权限 0 普通用户 1 组长 2 管理员
MEMBER = 0
MANAGER = 1
ADMIN = 2
# github access_token地址
GITHUB_ACCESS = "https://github.com/login/oauth/access_token"
# github获取用户信息
GITHUB_USER = "https://api.github.com/user"
# client_id
# CLIENT_ID = "0f4fc0a875de30614a6a"
CLIENT_ID = "c46c7ae33442d13498cd"
# SECRET
# SECRET_KEY = "a13c22377318291d5932bc5b62c1885b344355a0"
SECRET_KEY = "c79fafe58ff45f6b5b51ddde70d2d645209e38b9"
# 测试报告路径
REPORT_PATH = os.path.join(ROOT, "templates", "report.html")
# APP 路径
APP_PATH = os.path.join(ROOT, "app")
# dao路径
DAO_PATH = os.path.join(APP_PATH, 'crud')
SERVER_REPORT = "http://test.pity.fun/#/record/report/"
ALIYUN = "aliyun"
GITEE = "gitee"
RELATION = "pity_relation"
ALIAS = "__alias__"
TABLE_TAG = "__tag__"
# 数据库表展示的变更字段
FIELD = "__fields__"
SHOW_FIELD = "__show__"
IGNORE_FIELDS = ('created_at', "updated_at", "deleted_at", "create_user", "update_user")
# 请求类型
class BodyType(IntEnum):
none = 0
json = 1
form = 2
x_form = 3
binary = 4
graphQL = 5
# 全局变量的类型
class GconfigType:
case = 0
constructor = 1
asserts = 2
@staticmethod
def value(val):
if val == 0:
return "用例"
if val == 1:
return "前后置条件"
return "断言"
# 前置条件类型
class ConstructorType:
testcase = 0
sql = 1
redis = 2
py_script = 3
http = 4
# 日志类型
class OperationType:
INSERT = 0
UPDATE = 1
DELETE = 2
EXECUTE = 3
STOP = 4