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
ff3642c3
Commit
ff3642c3
authored
Apr 22, 2021
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医生/医院主页-问答接口
parent
71ebfe4f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
0 deletions
+57
-0
user_request.py
all_backend_api/user_request.py
+19
-0
user_request.yaml
all_backend_api/user_request.yaml
+11
-0
path_setting.py
path_setting.py
+3
-0
__init__.py
test_backend_case/user_case/__init__.py
+0
-0
test_answer.py
test_backend_case/user_case/test_answer.py
+18
-0
__init__.py
test_backend_data/user_data/__init__.py
+0
-0
answer.yaml
test_backend_data/user_data/answer.yaml
+6
-0
No files found.
all_backend_api/user_request.py
0 → 100644
View file @
ff3642c3
import
path_setting
from
in_common.base_request
import
BaseRequest
class
user_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
USER_ANSWER_CONFIG
)
#医院主页问答列表
def
answer
(
self
,
user
):
self
.
params
[
"user"
]
=
user
return
self
.
api_send
(
self
.
data
[
"answer"
])
if
__name__
==
'__main__'
:
#打印医生/医院主页问答列表接口返回
print
(
user_request
()
.
answer
(
"21476198"
))
\ No newline at end of file
all_backend_api/user_request.yaml
0 → 100644
View file @
ff3642c3
#医院主页-问答接口
answer
:
method
:
get
url
:
/api/user/answer
params
:
user
:
${user}
count
:
10
page
:
1
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
ff3642c3
...
...
@@ -40,6 +40,9 @@ HOSPITAL_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospital
#医生/医院主页-医生/医院说列表
DOCTOR_ARTICLE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"doctor_request.yaml"
)
DOCTOR_ARTICLE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/doctor_data"
,
"article.yaml"
)
#医生/医院主页-问答列表
USER_ANSWER_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"user_request.yaml"
)
USER_ANSWER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"answer.yaml"
)
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"
)
...
...
test_backend_case/user_case/__init__.py
0 → 100644
View file @
ff3642c3
test_backend_case/user_case/test_answer.py
0 → 100644
View file @
ff3642c3
import
pytest
from
all_backend_api.user_request
import
user_request
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
class
TestAnswer
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
USER_ANSWER
)
answer_case
,
answer_data
=
get_ids
(
data
,
"answer"
)
@pytest.mark.parametrize
(
"param"
,
answer_data
,
ids
=
answer_case
)
def
test_answer
(
self
,
param
):
r
=
user_request
()
.
answer
(
param
[
"user"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
test_backend_data/user_data/__init__.py
0 → 100644
View file @
ff3642c3
test_backend_data/user_data/answer.yaml
0 → 100644
View file @
ff3642c3
answer
:
-
case
:
"
校验接口返回成功case"
user
:
"
21476198"
assert_error
:
0
\ No newline at end of file
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