Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
d0ec24e4
Commit
d0ec24e4
authored
Aug 18, 2021
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送验证码
parent
9f2989bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
6 deletions
+48
-6
verification_code_request.py
all_backend_api/verification_code_request.py
+5
-6
verification_code_request.yaml
all_backend_api/verification_code_request.yaml
+10
-0
path_setting.py
path_setting.py
+5
-0
test_verification_code.py
...end_case/verification_code_case/test_verification_code.py
+17
-0
verification_code.yaml
...ackend_data/verification_code_data/verification_code.yaml
+11
-0
No files found.
all_backend_api/verification_code_request.py
View file @
d0ec24e4
...
...
@@ -4,14 +4,13 @@ from in_common.base_request import BaseRequest
class
verification_code_request
(
BaseRequest
):
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
):
self
.
params
[
"phone"
]
=
phone
self
.
params
[
"type"
]
=
type
self
.
params
[
"verifier"
]
=
verifier
return
self
.
api_send
(
self
.
data
[
"verfication_code"
])
return
self
.
api_send
(
self
.
data
[
"ver
i
fication_code"
])
if
__name__
==
'__main__'
:
# 个人中心
print
(
user_request
()
.
personal_center
())
\ No newline at end of file
if
__name__
==
'__main__'
:
print
(
verification_code_request
()
.
verification_code
(
12345678999
,
2
,
'fd94aa08c242a00496aba1e5b556c436'
))
\ No newline at end of file
all_backend_api/verification_code_request.yaml
View file @
d0ec24e4
verification_code
:
method
:
post
url
:
/api/verification_code
params
:
{}
data
:
phone
:
${phone}
type
:
${type}
verifier
:
${verifier}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
d0ec24e4
...
...
@@ -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
=
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__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
\ No newline at end of file
test_backend_case/verification_code_case/test_verification_code.py
View file @
d0ec24e4
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"
]
test_backend_data/verification_code_data/verification_code.yaml
View file @
d0ec24e4
verification_code
:
-
#发送验证码
case
:
"
发送验证码"
phone
:
12345678999
type
:
2
verifier
:
'
fd94aa08c242a00496aba1e5b556c436'
assert
:
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment