Commit 304ba12a authored by 陈湘湘's avatar 陈湘湘

一键登录

parent cfca6890
No preview for this file type
.gitignore
host.yaml
base_request.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
......@@ -102,4 +106,4 @@ venv.bak/
/site
# mypy
.mypy_cache/
\ No newline at end of file
.mypy_cache/
login_thirdphone:
method: post
url: /api/account/login/third_phone_login
params:
version: ${version}
data:
phone_data: ${phone_data}
phone_from_type: ${phone_from_type}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class thirdphonelogin_request(BaseRequest):
def __init__(self):
self.thirdphonelogin = self.api_load(path_setting.THIRD_PHONE_LOGIN_CONFIG)
def thirdphone_login(self,version,phone_data,phone_from_type):
self.params["version"] = version
self.params["phone_data"] = phone_data
self.params["phone_from_type"] = phone_from_type
return self.api_send(self.thirdphonelogin["login_thirdphone"])
develop_host:
# backend: http://backend.paas-develop.env
doctor: http://doctor.paas-develop.env
backend: http://backend.paas-develop.env
# doctor: http://doctor.paas-develop.env
......@@ -86,7 +86,7 @@ class BaseRequest:
params=req.get('params'),
# headers=user_headers,
data=req.get('data'),
json=req.get('json')
json=req.get('json'),
)
return r.json()
......
......@@ -36,6 +36,9 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml")
HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml")
THIRD_PHONE_LOGIN_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api", "thirdphonelogin_request")
THIRD_PHONE_LOGIN =os.path.join(BASE_DIR,"backend_auto/test_backend_data/account_data","login_thirdphone")
if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG)
from in_common.base_request import BaseRequest
import path_setting
from ids_list import get_ids
import pytest
from all_backend_api.thirdphonelogin_request import *
class TestThirdPhoneLogin:
data = BaseRequest().api_load(path_setting.THIRD_PHONE_LOGIN)
thirdphonelogin_case,thirdphonelogin_data = get_ids(data,"login_thirdphone")
@pytest.mark.parametrize("param",thirdphonelogin_data,ids = thirdphonelogin_case)
def test_thirdphone_login(self,param):
r = thirdphonelogin_request().thirdphone_login(param["version"],param["phone_data"],param["phone_from_type"])
if r["error"] == 1:
assert r['message'] == param["assert"]
\ No newline at end of file
login_thirdphone:
- case: "无版本号手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version:
assert: "获取手机号失败"
- case: "大于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version: "7.43.0"
assert: "获取手机号失败"
- case: "小于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version: "7.32.0"
assert: "获取手机号失败"
\ No newline at end of file
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