Commit 95104f7d by fanxun

Merge branch 'master' of…

Merge branch 'master' of C:\Users\fanxun\Desktop\work\接口测试\接口自动化测试\data_A接口测试\InterfaceAutoTest with conflicts.
parent 21c6a7de
class RedisBase: import requests
pass import json
from config import BaseConfig
def dingTalk(webhook, message):
"""发送消息到钉钉群"""
data = {'msgtype': 'text', 'text': {"content": message},
'at': {'isAtAll': True}}
post_data = json.dumps(data)
response = requests.post(webhook, headers=BaseConfig.headers, data=post_data)
return response.text
if __name__ == '__main__':
webhook = BaseConfig.webhook
message = '接口自动化这是测试数据再试试'
print(dingTalk(webhook, message))
class BaseConfig(): class BaseConfig():
"""基础配置类""" """基础配置类"""
# 请求头 # 请求头
headers = {'Content-Type': 'application/json; charset=utf-8'} headers = {'Content-Type': 'application/json; charset=utf-8'}
# 钉钉webhook # 钉钉webhook
webhook = 'https://oapi.dingtalk.com/robot/send?access_token=b818bea4452f154e0dda34d89d1ce34c253dda51cb761ed9f78d07d3169fe1d2' webhook = ''
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