Commit d0ec24e4 authored by edz's avatar edz

发送验证码

parent 9f2989bb
...@@ -4,14 +4,13 @@ from in_common.base_request import BaseRequest ...@@ -4,14 +4,13 @@ from in_common.base_request import BaseRequest
class verification_code_request(BaseRequest): class verification_code_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.VERIFICATION_CODE_CONFIG) self.data = self.api_load(path_setting.VERIFICATION_CODE_REQUEST_CONFIG)
#获取验证码 #获取验证码
def verification_code(self, phone,type,verifier): def verification_code(self, phone,type,verifier):
self.params["phone"] = phone self.params["phone"] = phone
self.params["type"] = type self.params["type"] = type
self.params["verifier"] = verifier self.params["verifier"] = verifier
return self.api_send(self.data["verfication_code"]) return self.api_send(self.data["verification_code"])
if __name__ == '__main__': if __name__ == '__main__':
# 个人中心 print(verification_code_request().verification_code(12345678999,2, 'fd94aa08c242a00496aba1e5b556c436'))
print(user_request().personal_center()) \ No newline at end of file
\ No newline at end of file
verification_code:
method: post
url: /api/verification_code
params: {}
data:
phone: ${phone}
type: ${type}
verifier: ${verifier}
json: {}
\ No newline at end of file
...@@ -782,5 +782,9 @@ FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_da ...@@ -782,5 +782,9 @@ FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_da
ACCOUNT_HOMEPAGE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml") ACCOUNT_HOMEPAGE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
ACCOUNT_HOMEPAGE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "account_homepage.yaml") ACCOUNT_HOMEPAGE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "account_homepage.yaml")
#获取验证码
VERIFICATION_CODE_REQUEST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "verification_code_request.yaml")
VERIFICATION_CODE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/verification_code_data", "verification_code.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
\ No newline at end of file
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.verification_code_request import verification_code_request
class TestVerificationCode:
data = BaseRequest().api_load(path_setting.VERIFICATION_CODE)
verification_code_case, verification_code_data = get_ids(data, "verification_code")
@pytest.mark.parametrize("param",verification_code_data, ids=verification_code_case)
def test_verification_code(self, param):
r = verification_code_request().verification_code(param["phone"], param["type"], param["verifier"])
if r["error"] == 0:
assert r["error"] == param["assert"]
verification_code:
-
#发送验证码
case: "发送验证码"
phone: 12345678999
type: 2
verifier: 'fd94aa08c242a00496aba1e5b556c436'
assert: 0
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