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
c8a9e42f
Commit
c8a9e42f
authored
May 27, 2021
by
陈雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医生后台
parent
29eeba0a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
132 additions
and
18 deletions
+132
-18
web2_request.py
all_doctor_api/web2_request.py
+11
-4
web2_request.yaml
all_doctor_api/web2_request.yaml
+17
-0
ids_list.py
ids_list.py
+5
-1
base_request.py
in_common/base_request.py
+2
-2
path_setting.py
path_setting.py
+4
-0
test_service_list.py
test_doctor_case/web2_case/test_service_list.py
+1
-1
test_service_review_list.py
test_doctor_case/web2_case/test_service_review_list.py
+5
-3
test_servicereview_option.py
test_doctor_case/web2_case/test_servicereview_option.py
+25
-0
service_list.yaml
test_doctor_data/web2_data/service_list.yaml
+34
-6
service_review_list.yaml
test_doctor_data/web2_data/service_review_list.yaml
+19
-1
servicereview_option.yaml
test_doctor_data/web2_data/servicereview_option.yaml
+9
-0
No files found.
all_doctor_api/web2_request.py
View file @
c8a9e42f
...
...
@@ -7,10 +7,11 @@ class web2_request(BaseRequest):
self
.
SERVICE_URL
=
self
.
api_load
(
path_setting
.
SERVICE_URL
)
# self.SERVICE_REVIEW_URL = self.api_load(path_setting.SERVICE_REVIEW_URL)
def
service_list
(
self
,
page
,
pagesize
,
is_online
):
def
service_list
(
self
,
page
,
pagesize
,
is_online
,
extra_filter_choice
):
self
.
params
[
"page"
]
=
page
self
.
params
[
"pagesize"
]
=
pagesize
self
.
params
[
"is_online"
]
=
is_online
self
.
params
[
"extra_filter_choice"
]
=
extra_filter_choice
return
self
.
api_send
(
self
.
SERVICE_URL
[
"service_list"
])
def
service_review_list
(
self
,
page
,
pagesize
,
type
):
...
...
@@ -19,8 +20,14 @@ class web2_request(BaseRequest):
self
.
params
[
"type"
]
=
type
return
self
.
api_send
(
self
.
SERVICE_URL
[
"service_review_list"
])
def
servicereview_option
(
self
,
id
,
type
,
csrfmiddlewaretoken
):
self
.
params
[
"id"
]
=
id
self
.
params
[
"type"
]
=
type
self
.
params
[
"csrfmiddlewaretoken"
]
=
csrfmiddlewaretoken
return
self
.
api_send
(
self
.
SERVICE_URL
[
"servicereview_option"
])
if
__name__
==
'__main__'
:
print
(
web2_request
()
.
service_list
(
"1"
,
"10"
,
"-1"
))
# print(web2_request().service_review_list("1", "10", "0"))
\ No newline at end of file
print
(
web2_request
()
.
service_list
(
"1"
,
"10"
,
"-1"
,
"-1"
))
print
(
web2_request
()
.
service_review_list
(
"1"
,
"10"
,
"0"
))
print
(
web2_request
()
.
servicereview_option
(
"209989"
,
"1"
,
""
))
\ No newline at end of file
all_doctor_api/web2_request.yaml
View file @
c8a9e42f
...
...
@@ -5,6 +5,7 @@ service_list:
page
:
${page}
pagesize
:
${pagesize}
is_online
:
${is_online}
extra_filter_choice
:
${extra_filter_choice}
data
:
phone_num
:
${phone_num}
vfc_code
:
${vfc_code}
...
...
@@ -26,3 +27,18 @@ service_review_list:
face_token
:
${face_token}
json
:
{}
isLogin
:
1
servicereview_option
:
method
:
POST
url
:
/api/web2/servicereview/option
params
:
{}
data
:
id
:
${id}
type
:
${type}
csrfmiddlewaretoken
:
${csrfmiddlewaretoken}
phone_num
:
${phone_num}
vfc_code
:
${vfc_code}
face_token
:
${face_token}
json
:
{}
isLogin
:
1
\ No newline at end of file
ids_list.py
View file @
c8a9e42f
...
...
@@ -2,7 +2,11 @@
此文件是用来将case转换成list
'''
def
get_ids
(
data
,
path
):
def
get_ids
(
data
:
object
,
path
:
object
)
->
object
:
"""
@rtype:
"""
params
=
data
[
path
]
case
=
[]
for
ids
in
params
:
...
...
in_common/base_request.py
View file @
c8a9e42f
...
...
@@ -25,7 +25,7 @@ class BaseRequest:
return
yaml
.
safe_load
(
f
)
# 调用yaml加载文件API加载
def
api_load
(
self
,
path
)
:
def
api_load
(
self
,
path
:
object
)
->
object
:
return
self
.
yaml_load
(
path
)
def
jsonpath
(
self
,
path
,
r
=
None
,
**
kwargs
):
...
...
@@ -33,7 +33,7 @@ class BaseRequest:
r
=
self
.
r
.
json
()
return
jsonpath
(
r
,
path
)
def
api_send
(
self
,
req
:
dict
)
:
def
api_send
(
self
,
req
:
object
)
->
object
:
host
=
self
.
api_load
(
path_setting
.
HOSTYAML_CONFIG
)
# 获取调用该方法的路径
...
...
path_setting.py
View file @
c8a9e42f
...
...
@@ -25,6 +25,10 @@ SERVICE_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web2_request.
#医生后台-商品审核
SERVICE_REVIEW_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web2_data"
,
"service_review_list.yaml"
)
#医生后台-新商品审核-撤回审核
SERVICEREVIEW_OPTION_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web2_data"
,
"servicereview_option.yaml"
)
#搜索首页-热门搜索
KEYWORDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
KEYWORDS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"keywords.yaml"
)
...
...
test_doctor_case/web2_case/test_service_list.py
View file @
c8a9e42f
...
...
@@ -13,7 +13,7 @@ class TestServiceList:
@pytest.mark.parametrize
(
"params"
,
ServiceList_data
,
ids
=
ServiceList_case
)
def
test_ServiceList
(
self
,
params
):
r
=
web2_request
()
.
service_list
(
params
[
'page'
],
params
[
'pagesize'
],
params
[
'is_online'
])
r
=
web2_request
()
.
service_list
(
params
[
'page'
],
params
[
'pagesize'
],
params
[
'is_online'
]
,
params
[
'extra_filter_choice'
]
)
print
(
"======"
,
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"page"
]
==
params
[
"assert"
]
...
...
test_doctor_case/web2_case/test_service_review_list.py
View file @
c8a9e42f
...
...
@@ -13,9 +13,11 @@ class TestServiceReviewList:
@pytest.mark.parametrize
(
"params"
,
ServiceReviewList_data
,
ids
=
ServiceReviewList_case
)
def
test_ServiceReviewList
(
self
,
params
):
r
=
web2_request
()
.
service_review_list
(
params
[
'page'
],
params
[
'pagesize'
],
params
[
'type'
])
print
(
"---------"
,
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"page"
]
==
params
[
"assert"
]
elif
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
params
[
"assert"
]
\ No newline at end of file
# elif r["error"] == 1:
# assert r["message"] == params["assert"]
\ No newline at end of file
test_doctor_case/web2_case/test_servicereview_option.py
0 → 100644
View file @
c8a9e42f
import
pytest
import
path_setting
from
all_doctor_api.web2_request
import
web2_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestServicereviewOption
:
servicereview_option
=
BaseRequest
()
.
api_load
(
path_setting
.
SERVICEREVIEW_OPTION_DATA
)
ServicereviewOption_case
,
ServicereviewOption_data
=
get_ids
(
servicereview_option
,
"servicereview_option"
)
@pytest.mark.parametrize
(
"params"
,
ServicereviewOption_data
,
ids
=
ServicereviewOption_case
)
def
test_ServicereviewOption
(
self
,
params
):
r
=
web2_request
()
.
servicereview_option
(
params
[
'id'
],
params
[
'type'
],
params
[
'csrfmiddlewaretoken'
])
print
(
"---------"
,
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
params
[
"assert"
]
# elif r["error"] == 1:
# assert r["data"] == params["assert"]
\ No newline at end of file
test_doctor_data/web2_data/service_list.yaml
View file @
c8a9e42f
service_list
:
#有数据返回
#
我的商品菜单下
有数据返回
-
case
:
"
我的商品-
有数据返回
"
case
:
"
我的商品-
全部tab
"
page
:
"
1"
pagesize
:
"
10"
is_online
:
"
-1"
extra_filter_choice
:
"
-1"
assert
:
1
-
case
:
"
我的商品-上线tab"
page
:
"
1"
pagesize
:
"
10"
is_online
:
"
-1"
extra_filter_choice
:
"
-1"
assert
:
1
-
case
:
"
我的商品-下线tab"
page
:
"
1"
pagesize
:
"
10"
is_online
:
"
0"
extra_filter_choice
:
"
-1"
assert
:
1
service_review_list
:
#有数据返回
-
case
:
"
商品审核-有数据返回
"
case
:
"
我的商品-待升级(全部tab)
"
page
:
"
1"
pagesize
:
"
10"
type
:
"
0"
is_online
:
"
-1"
extra_filter_choice
:
"
0"
assert
:
1
-
case
:
"
我的商品-待修改类目(全部tab)有数据返回"
page
:
"
1"
pagesize
:
"
10"
is_online
:
"
-1"
extra_filter_choice
:
"
1"
assert
:
1
test_doctor_data/web2_data/service_review_list.yaml
View file @
c8a9e42f
service_review_list
:
#有数据返回
-
case
:
"
商品审核-
有数据返回
"
case
:
"
商品审核-
新商品审核
"
page
:
"
1"
pagesize
:
"
10"
type
:
"
0"
assert
:
1
-
case
:
"
商品审核-商品修改审核"
page
:
"
1"
pagesize
:
"
10"
type
:
"
1"
assert
:
1
-
case
:
"
商品审核-新商品审核"
page
:
"
1"
pagesize
:
"
10"
type
:
"
2"
assert
:
1
test_doctor_data/web2_data/servicereview_option.yaml
0 → 100644
View file @
c8a9e42f
servicereview_option
:
#有数据返回
-
case
:
"
商品审核-撤回审核"
id
:
"
209989"
type
:
"
1"
csrfmiddlewaretoken
:
"
PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert
:
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