Commit 28c3cbde authored by 蒲肖建's avatar 蒲肖建

Merge branch 'puxiaojian' into 'master'

GOS接口自动化测试项目提交 See merge request !1
parents 4485fb09 a91a2ddf
[host]
host = geek.jkwljy.com
[ding_ding_url]
web_hook = https://oapi.dingtalk.com/robot/send?access_token=94b76afb5b538437e9986e95bd9e4c882cfcf3c75e8c1b3a6f209cac403b8e00
[path]
report_path = data/report/jky_report.xls
[email]
host = smtp.exmail.qq.com
port = 465
from_adress = puxiaojian@jiuaoedu.com
password = Xj15208176554
to_adresses = puxiaojian6554@dingtalk.com
[postgreSql]
database = edu-admin
user = dev
password = mko0PL<.;?
host = 192.168.32.41
port = 5432"
[headers]
header1 = {"Content-Type": "application/json;charset=UTF-8","Accept": "application/json, text/plain, */*"}
header2 = {"Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer ${applet_token}"}
header3 = {"Accept": "application/json, text/plain, */*"}
header4 = {"Content-Type": "application/x-www-form-urlencoded","Accept": "application/json, text/plain, */*"}
[global_variable]
init_global_variable = {}
[GOS]
api_data_path = data/api/jky_api.xlsx
sheet_name = login,buy_class
#sheet_name = login
request_data_path = data/request_data/jky_request_data.xlsx
\ No newline at end of file
# coding:utf-8
import sys
from hq_framework.main.run_api import Run
from hq_framework.main import init_conf
from hq_framework.common.operation_log import Log
log = Log(__name__).get_logger()
class GetSysArgs:
def __init__(self, args: list):
if len(args) == 2:
self.ip = args[1]
print(self.ip)
log.info("输入的命令行参数args: %s" % args)
else:
print(args)
self.ip = "132.232.15.12"
log.info("输入的命令行参数args: %s没有ip或参数过多使用: ip: 132.232.15.12" % args)
def get_ip(self):
if self.ip == "geek.jkwljy.com" or self.validate_ip():
return self.ip
else:
log.info("输入的ip:%s有误,使用默认Ip: ip: 132.232.15.12" % self.ip)
return "132.232.15.12"
def validate_ip(self) -> bool:
sep = self.ip.split(':')[0].split(".")
if len(sep) != 4:
return False
for i, x in enumerate(sep):
try:
int_x = int(x)
if int_x < 0 or int_x > 255:
return False
except ValueError:
return False
return True
if __name__ == "__main__":
ip = GetSysArgs(sys.argv).get_ip()
print("获取的ip:" + ip)
log.info("用于初始化config的ip:" + ip)
config_path = "data/config/config.conf"
path_config_path = "data/config/data_path.conf"
init_conf.InitConfig(ip, config_path)
Run(config_path, path_config_path).run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment