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
8b575b7b
Commit
8b575b7b
authored
Jul 15, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日记本--美购相关
parent
882befc4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
35 deletions
+33
-35
diary_request.py
all_backend_api/diary_request.py
+1
-1
test_service.py
test_backend_case/diary_case/test_service.py
+14
-25
diary_service.yaml
test_backend_data/diary_data/diary_service.yaml
+18
-9
No files found.
all_backend_api/diary_request.py
View file @
8b575b7b
...
...
@@ -14,7 +14,7 @@ class diary_request(BaseRequest):
def
diary_cancelfavor
(
self
):
return
self
.
api_send
(
self
.
data
[
"cancelfavor"
])
# 更新日记本
无权限
# 更新日记本
信息
def
diary_operation
(
self
,
diary_id
,
title
,
operation_timestamp
,
doctor_name
,
hospital_name
):
self
.
params
[
"diary_id"
]
=
diary_id
self
.
params
[
"title"
]
=
title
...
...
test_backend_case/diary_case/test_service.py
View file @
8b575b7b
...
...
@@ -7,36 +7,25 @@ from all_backend_api.diary_request import diary_request
class
TestDiaryService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_
DATA
)
diary_
data_case
,
diary_data_data
=
get_ids
(
data
,
"diary_data
"
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_
SERVICE
)
diary_
service_case
,
diary_service_data
=
get_ids
(
data
,
"diary_service
"
)
@pytest.mark.parametrize
(
"param"
,
diary_data_data
,
ids
=
diary_data
_case
)
def
test_diary_service
(
self
,
param
):
@pytest.mark.parametrize
(
"param"
,
diary_service_data
,
ids
=
diary_service
_case
)
def
test_diary_service
(
self
,
param
):
# print(2)
r
=
diary_request
()
.
diary_
data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num
"
])
r
=
diary_request
()
.
diary_
service
(
param
[
"diary_id"
],
param
[
"service_id
"
])
# print(r)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if
r
[
"data"
]:
assert
r
[
"data"
][
0
][
"post_date"
]
is
not
None
and
r
[
"data"
][
0
][
"post_date"
]
is
not
""
#c创建时间
assert
r
[
"data"
][
0
][
"diary_num"
]
is
not
None
and
r
[
"data"
][
0
][
"diary_num"
]
is
not
""
#日记总数
assert
r
[
"data"
][
0
][
"view_count"
]
is
not
None
and
r
[
"data"
][
0
][
"view_count"
]
is
not
""
#浏览次数
assert
r
[
"data"
][
0
][
"is_liked"
]
is
not
None
and
r
[
"data"
][
0
][
"is_liked"
]
is
not
""
#是否点赞
assert
r
[
"data"
][
0
][
"operation_day"
]
is
not
None
and
r
[
"data"
][
0
][
"operation_day"
]
is
not
""
#术后多少天
assert
r
[
"data"
][
0
][
"vote_count"
]
is
not
None
and
r
[
"data"
][
0
][
"vote_count"
]
is
not
""
#点赞总数
assert
r
[
"data"
][
0
][
"reply_count"
]
is
not
None
and
r
[
"data"
][
0
][
"reply_count"
]
is
not
""
#评论总数
assert
r
[
"data"
][
0
][
"id"
]
is
not
None
and
r
[
"data"
][
0
][
"id"
]
is
not
""
#日记贴id
# 判断评论列表里面的用户信息是否为空,先判断有没有评论
if
r
[
"data"
][
0
][
"comments"
]:
assert
r
[
"data"
][
0
][
"comments"
][
0
][
"user_id"
]
is
not
None
and
r
[
"data"
][
0
][
"comments"
][
0
][
"user_id"
]
is
not
""
#用户id
assert
r
[
"data"
][
0
][
"comments"
][
0
][
"nick_name"
]
is
not
None
and
r
[
"data"
][
0
][
"comments"
][
0
][
"nick_name"
]
is
not
""
#用户名
assert
r
[
"data"
][
0
][
"comments"
][
0
][
"gm_url"
]
is
not
None
and
r
[
"data"
][
0
][
"comments"
][
0
][
"gm_url"
]
is
not
""
#点击头像跳转链接
# assert(r[""])
if
r
[
"error"
]
==
1
:
assert
r
[
"error"
]
==
param
[
"assert"
]
# 先判断有没有美购的字段,没有就检验接口就行,然后判断接口里面需要的那些字段是否不传值,传空值
if
r
[
"data"
][
"service_data"
]:
assert
r
[
"data"
][
"service_data"
][
"gengmei_price"
]
is
not
None
and
r
[
"data"
][
"service_data"
][
"gengmei_price"
]
is
not
""
# 更美价
assert
r
[
"data"
][
"service_data"
][
"service_name"
]
is
not
None
and
r
[
"data"
][
"service_data"
][
"service_name"
]
is
not
""
# 美购名称
assert
r
[
"data"
][
"service_data"
][
"gm_url"
]
is
not
None
and
r
[
"data"
][
"service_data"
][
"gm_url"
]
is
not
""
# 跳转链接
assert
r
[
"data"
][
"service_data"
][
"is_seckill"
]
is
not
None
and
r
[
"data"
][
"service_data"
][
"is_seckill"
]
is
not
""
# 是否秒杀
...
...
test_backend_data/diary_data/diary_service.yaml
View file @
8b575b7b
diary_service
:
#字段正常case
-
case
:
"
有推荐美购的日记
--有外显评论
"
diary_id
:
"
"
service_id
:
58
15774
case
:
"
有推荐美购的日记"
diary_id
:
17586147
service_id
:
58
78139
assert
:
0
-
case
:
"
接口传参数失败,但不报错case"
current_city_id
:
"
beijing"
diary_referrer
:
"
my_diary"
sort
:
0
count
:
8
start_num
:
2
case
:
"
已下线的推荐美购的日记"
diary_id
:
17586094
service_id
:
5885050
assert
:
0
-
case
:
"
没有推荐美购的日记"
diary_id
:
17586140
service_id
:
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