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
2cc9caa1
Commit
2cc9caa1
authored
Apr 19, 2021
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医院主页商品列表接口
parent
7c17ab53
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
1 deletion
+93
-1
hospitals_v2_request.py
all_backend_api/hospitals_v2_request.py
+17
-0
hospitals_v2_request.yaml
all_backend_api/hospitals_v2_request.yaml
+12
-0
path_setting.py
path_setting.py
+3
-1
__init__.py
test_backend_case/hospitals_v2_case/__init__.py
+0
-0
test_services.py
test_backend_case/hospitals_v2_case/test_services.py
+29
-0
__init__.py
test_backend_data/hospitals_v2_data/__init__.py
+0
-0
services.yaml
test_backend_data/hospitals_v2_data/services.yaml
+32
-0
No files found.
all_backend_api/hospitals_v2_request.py
0 → 100644
View file @
2cc9caa1
import
path_setting
from
in_common.base_request
import
BaseRequest
class
hospitals_v2_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
HOSPITAL_SERVICE_CONFIG
)
#医院主页商品列表
def
services
(
self
):
return
self
.
api_send
(
self
.
data
[
"services"
])
if
__name__
==
'__main__'
:
#打印医院主页商品列表接口返回
print
(
hospitals_v2_request
()
.
services
())
\ No newline at end of file
all_backend_api/hospitals_v2_request.yaml
0 → 100644
View file @
2cc9caa1
#商品列表
services
:
method
:
get
url
:
/api/hospitals_v2/bjxyjcpfbyy/services
params
:
offset
:
0
show_tag_distro
:
1
tag_id
:
"
all"
size
:
10
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
2cc9caa1
...
@@ -31,7 +31,9 @@ HDYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospital
...
@@ -31,7 +31,9 @@ HDYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospital
HOSPITAL_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"detail.yaml"
)
HOSPITAL_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"detail.yaml"
)
#医院主页医生列表
#医院主页医生列表
HOSPITAL_DOCTOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"doctor.yaml"
)
HOSPITAL_DOCTOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_data"
,
"doctor.yaml"
)
#医院主页商品列表
HOSPITAL_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hospitals_v2_request.yaml"
)
HOSPITAL_SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hospitals_v2_data"
,
"services.yaml"
)
HOME_V5_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"service_request.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"
)
HOME_V5
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/service_data"
,
"home_v5.yaml"
)
...
...
test_backend_case/hospitals_v2_case/__init__.py
0 → 100644
View file @
2cc9caa1
test_backend_case/hospitals_v2_case/test_services.py
0 → 100644
View file @
2cc9caa1
import
pytest
from
all_backend_api.hospitals_v2_request
import
hospitals_v2_request
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
class
TestServices
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
HOSPITAL_SERVICE
)
services_case
,
services_data
=
get_ids
(
data
,
"services"
)
@pytest.mark.parametrize
(
"param"
,
services_data
,
ids
=
services_case
)
def
test_detail
(
self
,
param
):
r
=
hospitals_v2_request
()
.
services
()
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert_error"
]
assert
r
[
"data"
][
"services"
][
0
][
"service_item_id"
]
==
param
[
"assert_sku"
]
assert
r
[
"data"
][
"services"
][
0
][
"service_id"
]
==
param
[
"assert_spu"
]
assert
r
[
"data"
][
"services"
][
0
][
"price_info"
][
"has_discount"
]
==
param
[
"assert_discount"
]
assert
r
[
"data"
][
"services"
][
0
][
"sales_info"
][
0
][
"type"
]
==
param
[
"assert_sales"
]
assert
r
[
"data"
][
"services"
][
0
][
"exposure"
][
"card_type"
]
==
param
[
"assert_card_type"
]
assert
r
[
"data"
][
"services"
][
0
][
"title"
]
==
param
[
"assert_title"
]
assert
r
[
"data"
][
"tag_distribution"
][
0
][
"selected"
]
==
param
[
"assert_tagselected"
]
test_backend_data/hospitals_v2_data/__init__.py
0 → 100644
View file @
2cc9caa1
test_backend_data/hospitals_v2_data/services.yaml
0 → 100644
View file @
2cc9caa1
services
:
-
case
:
"
校验接口调用成功case"
assert_error
:
0
assert_sku
:
546450
assert_spu
:
5866530
assert_discount
:
True
assert_sales
:
3
assert_card_type
:
"
card"
assert_title
:
"
【G点注射】G点注射激活修复,G点玻尿酸注射唤醒
提升G点敏感度
提升塑造敏感G点
G点增厚
小阴唇整形
修复矫正"
assert_tagselected
:
true
-
case
:
"
校验商品数据case"
assert_error
:
0
assert_sku
:
546450
assert_spu
:
5866530
assert_discount
:
True
assert_sales
:
3
assert_card_type
:
"
card"
assert_title
:
"
【G点注射】G点注射激活修复,G点玻尿酸注射唤醒
提升G点敏感度
提升塑造敏感G点
G点增厚
小阴唇整形
修复矫正"
assert_tagselected
:
true
-
case
:
"
校验商品标签数据case"
assert_error
:
0
assert_sku
:
546450
assert_spu
:
5866530
assert_discount
:
True
assert_sales
:
3
assert_card_type
:
"
card"
assert_title
:
"
【G点注射】G点注射激活修复,G点玻尿酸注射唤醒
提升G点敏感度
提升塑造敏感G点
G点增厚
小阴唇整形
修复矫正"
assert_tagselected
:
true
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