Commit 6e95819e by fanxun

Merge branch 'fx'

parents b5abe1cb 026c7355
...@@ -3,21 +3,13 @@ ...@@ -3,21 +3,13 @@
class BaseConfig(): class BaseConfig():
"""基础配置类""" """基础配置类"""
# 请求头 # 请求头
headers = {'Content-Type': 'application/json; charset=utf-8'} headers = {'Content-Type': 'application/json'}
# 当前运行的产品名 # 当前运行的产品名
current_product = "" current_product = ""
webhook = ''
salt = 'hikcreate_xj'
class BMCConfig(BaseConfig): class BMCConfig(BaseConfig):
"""斑马信用app的配置类""" """斑马信用app的配置类"""
pass pass
\ No newline at end of file
class DingTalk(BaseConfig):
"""钉钉机器人"""
webhook = ''
class SSOLoginConfig(BaseConfig):
"""登录配置"""
salt = 'hikcreate_xj'
\ No newline at end of file
import pytest
import requests
from config import BaseConfig
from common.utils.encryption import Encryption
# from common.utils.getExcelData import get_excelData
from common.tools import request_main
@pytest.fixture(scope='session')
def sso_login(url, headers, method, data):
"""SSO登录"""
req_data = {"loginName":"fanxun","password":"fx123456"}
password = req_data['password']
md5_password = Encryption().get_md5(password, salt=BaseConfig.salt)
req_data['password'] = md5_password
res = request_main(url, headers, method, req_data)
print(res)
def sso_login():
"""sso登录"""
pass
def bmy_login(): def bmy_login():
...@@ -11,4 +24,12 @@ def bmy_login(): ...@@ -11,4 +24,12 @@ def bmy_login():
pass pass
if __name__ == '__main__':
# login = request_main(url=r'http://testtbdzj.hikcreate.com/web/auth/users/login',
# method='post',
# data={"loginName":"fanxun","password":"d67fac1d71943576b6c397d0cca166cb"},
# headers=getattr(BaseConfig, 'headers'))
sso_login(r'http://testtbdzj.hikcreate.com/web/auth/users/login',
headers=getattr(BaseConfig, 'headers'),
method='post',
data=None)
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