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
ca5c338b
Commit
ca5c338b
authored
Jul 01, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码规范--新增创建帖子接口
parent
ecc83e8f
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
252 additions
and
35 deletions
+252
-35
tractate_request.py
all_backend_api/tractate_request.py
+6
-2
tractate_request.yaml
all_backend_api/tractate_request.yaml
+21
-0
path_setting.py
path_setting.py
+2
-2
test_answer_answer_reply_vote.py
...backend_case/hybrid_case/test_answer_answer_reply_vote.py
+2
-5
test_question_new_answer_list.py
...backend_case/hybrid_case/test_question_new_answer_list.py
+3
-3
test_question_v1.py
test_backend_case/hybrid_case/test_question_v1.py
+2
-2
test_product_mall_service_home_feed.py
...nd_case/janus_case/test_product_mall_service_home_feed.py
+2
-2
test_favor.py
test_backend_case/qa_case/test_favor.py
+2
-2
test_home_feed.py
test_backend_case/service_case/test_home_feed.py
+2
-2
test_create.py
test_backend_case/tractate_case/test_create.py
+33
-0
test_favor.py
test_backend_case/tractate_case/test_favor.py
+2
-2
test_publish_reply.py
test_backend_case/tractate_case/test_publish_reply.py
+2
-2
test_reply.py
test_backend_case/tractate_case/test_reply.py
+2
-2
test_vote.py
test_backend_case/tractate_case/test_vote.py
+56
-6
create.yaml
test_backend_data/tractate_data/create.yaml
+12
-0
vote.yaml
test_backend_data/tractate_data/vote.yaml
+103
-3
No files found.
all_backend_api/tractate_request.py
View file @
ca5c338b
...
@@ -53,7 +53,6 @@ class tractate_request(BaseRequest):
...
@@ -53,7 +53,6 @@ class tractate_request(BaseRequest):
self
.
params
[
"reply_id"
]
=
reply_id
self
.
params
[
"reply_id"
]
=
reply_id
return
self
.
api_send
(
self
.
data
[
"tractate_cancelvote"
])
return
self
.
api_send
(
self
.
data
[
"tractate_cancelvote"
])
# 帖子创建一级&二级评论
# 帖子创建一级&二级评论
def
publish_reply
(
self
,
tractate_id
,
data_type
,
reply_id
,
content
):
def
publish_reply
(
self
,
tractate_id
,
data_type
,
reply_id
,
content
):
self
.
params
[
"tractate_id"
]
=
tractate_id
self
.
params
[
"tractate_id"
]
=
tractate_id
...
@@ -62,5 +61,10 @@ class tractate_request(BaseRequest):
...
@@ -62,5 +61,10 @@ class tractate_request(BaseRequest):
self
.
params
[
"content"
]
=
content
self
.
params
[
"content"
]
=
content
return
self
.
api_send
(
self
.
data
[
"publish_reply"
])
return
self
.
api_send
(
self
.
data
[
"publish_reply"
])
# 帖子创建--登录下
def
create
(
self
):
return
self
.
api_send
(
self
.
data
[
"create"
])
# 帖子创建--未登录下
def
create_unlogin
(
self
):
return
self
.
api_send
(
self
.
data
[
"create_unlogin"
])
all_backend_api/tractate_request.yaml
View file @
ca5c338b
...
@@ -100,4 +100,24 @@ publish_reply:
...
@@ -100,4 +100,24 @@ publish_reply:
content
:
${content}
content
:
${content}
json
:
{}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#帖子创建一-未登录
create_unlogin
:
method
:
get
url
:
/api/tractate/create
params
:
data
:
json
:
{}
isLogin
:
0
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#帖子创建一-登录
create
:
method
:
get
url
:
/api/tractate/create
params
:
data
:
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#
\ No newline at end of file
path_setting.py
View file @
ca5c338b
...
@@ -85,6 +85,8 @@ TRACTATE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate
...
@@ -85,6 +85,8 @@ TRACTATE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate
TRACTATE_VOTE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/tractate_data"
,
"vote.yaml"
)
TRACTATE_VOTE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/tractate_data"
,
"vote.yaml"
)
# 帖子详情页--一级评论创建
# 帖子详情页--一级评论创建
TRACTATE_PUBLISH_REPLY
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/tractate_data"
,
"publish_reply.yaml"
)
TRACTATE_PUBLISH_REPLY
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/tractate_data"
,
"publish_reply.yaml"
)
#发帖子--帖子内容创建
TRACTATE_CREATE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/tractate_data"
,
"create.yaml"
)
# 问答详情页--问题详情
# 问答详情页--问题详情
...
@@ -97,8 +99,6 @@ ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data
...
@@ -97,8 +99,6 @@ ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data
QA_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"qa_request.yaml"
)
QA_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"qa_request.yaml"
)
# -问题的收藏&取消收藏
# -问题的收藏&取消收藏
QA_FAVOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/qa_data"
,
"favor.yaml"
)
QA_FAVOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/qa_data"
,
"favor.yaml"
)
# -test的文件,尝试在不动原函数的基础上加参数而不是用默认参数。--没必要
# TEST_QA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/qa_data", "test.yaml")
# 回答评论点赞&取消点赞
# 回答评论点赞&取消点赞
...
...
test_backend_case/hybrid_case/test_answer_answer_reply_vote.py
View file @
ca5c338b
...
@@ -8,14 +8,13 @@ from all_backend_api.hybrid_request import hybrid_request
...
@@ -8,14 +8,13 @@ from all_backend_api.hybrid_request import hybrid_request
class
TestAnswerAnswerReplyVote
:
class
TestAnswerAnswerReplyVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QA_REPLY_VOTE
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QA_REPLY_VOTE
)
test_case
,
test
_data
=
get_ids
(
data
,
"answer_reply_vote"
)
answeranswerreplyvote_case
,
answeranswerreplyvote
_data
=
get_ids
(
data
,
"answer_reply_vote"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
answeranswerreplyvote_data
,
ids
=
answeranswerreplyvote
_case
)
def
test_answer_answer_reply_vote
(
self
,
param
):
def
test_answer_answer_reply_vote
(
self
,
param
):
# 直接点赞,看是否能点赞,如果返回1,就直接进入取消点赞
# 直接点赞,看是否能点赞,如果返回1,就直接进入取消点赞
vote
=
hybrid_request
()
.
answer_reply_vote
(
param
[
"id"
])
vote
=
hybrid_request
()
.
answer_reply_vote
(
param
[
"id"
])
if
vote
[
"error"
]
==
0
:
if
vote
[
"error"
]
==
0
:
print
(
1
)
# 校验二次点赞无效
# 校验二次点赞无效
vote
=
hybrid_request
()
.
answer_reply_vote
(
param
[
"id"
])
vote
=
hybrid_request
()
.
answer_reply_vote
(
param
[
"id"
])
assert
vote
[
"message"
]
==
param
[
"assert3"
]
assert
vote
[
"message"
]
==
param
[
"assert3"
]
...
@@ -23,14 +22,12 @@ class TestAnswerAnswerReplyVote:
...
@@ -23,14 +22,12 @@ class TestAnswerAnswerReplyVote:
# 取消点赞,回到取消点赞的状态
# 取消点赞,回到取消点赞的状态
cancelvote
=
hybrid_request
()
.
answer_reply_cancel_vote
(
param
[
"id"
])
cancelvote
=
hybrid_request
()
.
answer_reply_cancel_vote
(
param
[
"id"
])
assert
cancelvote
[
"error"
]
==
0
assert
cancelvote
[
"error"
]
==
0
print
(
2
)
else
:
else
:
assert
vote
[
"error"
]
==
1
assert
vote
[
"error"
]
==
1
assert
vote
[
"message"
]
==
param
[
"assert3"
]
assert
vote
[
"message"
]
==
param
[
"assert3"
]
# 取消点赞,回到取消点赞的状态
# 取消点赞,回到取消点赞的状态
cancelvote
=
hybrid_request
()
.
answer_reply_cancel_vote
(
param
[
"id"
])
cancelvote
=
hybrid_request
()
.
answer_reply_cancel_vote
(
param
[
"id"
])
assert
cancelvote
[
"error"
]
==
0
assert
cancelvote
[
"error"
]
==
0
print
(
2
)
...
...
test_backend_case/hybrid_case/test_question_new_answer_list.py
View file @
ca5c338b
...
@@ -7,11 +7,11 @@ from all_backend_api.hybrid_request import hybrid_request
...
@@ -7,11 +7,11 @@ from all_backend_api.hybrid_request import hybrid_request
class
TestQuestionNewAnswerLi
i
st
:
class
TestQuestionNewAnswerList
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ANSWER_LIST
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ANSWER_LIST
)
test_case
,
te
st_data
=
get_ids
(
data
,
"question_new_answer_list"
)
questionnewanswerlist_case
,
questionnewanswerli
st_data
=
get_ids
(
data
,
"question_new_answer_list"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
te
st_case
)
@pytest.mark.parametrize
(
"param"
,
questionnewanswerlist_data
,
ids
=
questionnewanswerli
st_case
)
def
test_question_v1
(
self
,
param
):
def
test_question_v1
(
self
,
param
):
r
=
hybrid_request
()
.
question_new_answer_list
(
param
[
"question_id"
])
r
=
hybrid_request
()
.
question_new_answer_list
(
param
[
"question_id"
])
if
r
[
"error"
]
==
0
:
if
r
[
"error"
]
==
0
:
...
...
test_backend_case/hybrid_case/test_question_v1.py
View file @
ca5c338b
...
@@ -9,9 +9,9 @@ from all_backend_api.hybrid_request import hybrid_request
...
@@ -9,9 +9,9 @@ from all_backend_api.hybrid_request import hybrid_request
class
TestQuestionV1
:
class
TestQuestionV1
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QUESTION_DETAIL
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QUESTION_DETAIL
)
test_case
,
test
_data
=
get_ids
(
data
,
"question_v1"
)
questionv1_case
,
questionv1
_data
=
get_ids
(
data
,
"question_v1"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test_case
)
@pytest.mark.parametrize
(
"param"
,
questionv1_case
,
ids
=
questionv1_data
)
def
test_question_v1
(
self
,
param
):
def
test_question_v1
(
self
,
param
):
r
=
hybrid_request
()
.
question_v1
()
r
=
hybrid_request
()
.
question_v1
()
assert
r
[
"error"
]
==
param
[
"error"
]
assert
r
[
"error"
]
==
param
[
"error"
]
...
...
test_backend_case/janus_case/test_product_mall_service_home_feed.py
View file @
ca5c338b
...
@@ -8,9 +8,9 @@ from all_backend_api.janus_request import janus_request
...
@@ -8,9 +8,9 @@ from all_backend_api.janus_request import janus_request
class
TestProductMallServiceHomeFeed
:
class
TestProductMallServiceHomeFeed
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FEED_TAB_SERVICE
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FEED_TAB_SERVICE
)
test_case
,
test
_data
=
get_ids
(
data
,
"feed_service"
)
productmallservicehomefeed_case
,
productmallservicehomefeed
_data
=
get_ids
(
data
,
"feed_service"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
productmallservicehomefeed_data
,
ids
=
productmallservicehomefeed
_case
)
def
test_product_mall_service_home_feed
(
self
,
param
):
def
test_product_mall_service_home_feed
(
self
,
param
):
r
=
janus_request
()
.
feed_service
(
param
[
"tab_value"
],
param
[
"first_load"
])
r
=
janus_request
()
.
feed_service
(
param
[
"tab_value"
],
param
[
"first_load"
])
assert
r
[
"error"
]
==
0
assert
r
[
"error"
]
==
0
...
...
test_backend_case/qa_case/test_favor.py
View file @
ca5c338b
...
@@ -8,9 +8,9 @@ from all_backend_api.qa_request import qa_request
...
@@ -8,9 +8,9 @@ from all_backend_api.qa_request import qa_request
class
TestFavor
:
class
TestFavor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QA_FAVOR
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QA_FAVOR
)
test_case
,
test
_data
=
get_ids
(
data
,
"favor"
)
favor_case
,
favor
_data
=
get_ids
(
data
,
"favor"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
favor_data
,
ids
=
favor
_case
)
def
test_favor
(
self
,
param
):
def
test_favor
(
self
,
param
):
r
=
qa_request
()
.
favor
(
param
[
"answer_id"
])
r
=
qa_request
()
.
favor
(
param
[
"answer_id"
])
assert
r
[
"error"
]
==
param
[
"error"
]
assert
r
[
"error"
]
==
param
[
"error"
]
...
...
test_backend_case/service_case/test_home_feed.py
View file @
ca5c338b
...
@@ -8,9 +8,9 @@ from all_backend_api.service_request import service_request
...
@@ -8,9 +8,9 @@ from all_backend_api.service_request import service_request
class
TestProductMallServiceHomeFeed
:
class
TestProductMallServiceHomeFeed
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FEED_TAB_SERVICE_DOCTORS
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FEED_TAB_SERVICE_DOCTORS
)
test_case
,
test
_data
=
get_ids
(
data
,
"home_feed"
)
productmallservicehomefeed_case
,
productmallservicehomefeed
_data
=
get_ids
(
data
,
"home_feed"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
productmallservicehomefeed_data
,
ids
=
productmallservicehomefeed
_case
)
def
test_product_mall_service_home_feed
(
self
,
param
):
def
test_product_mall_service_home_feed
(
self
,
param
):
r
=
service_request
()
.
feed_home
(
param
[
"tab_value"
],
param
[
"input_type"
])
r
=
service_request
()
.
feed_home
(
param
[
"tab_value"
],
param
[
"input_type"
])
assert
r
[
"error"
]
==
0
assert
r
[
"error"
]
==
0
...
...
test_backend_case/tractate_case/test_create.py
0 → 100644
View file @
ca5c338b
import
json
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.tractate_request
import
tractate_request
class
TestCreate
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_CREATE
)
create_case
,
create_data
=
get_ids
(
data
,
"create"
)
@pytest.mark.parametrize
(
"param"
,
create_data
,
ids
=
create_case
)
def
test_create
(
self
,
param
):
# 登录了的-校验
r
=
tractate_request
()
.
create
()
assert
r
[
"error"
]
==
param
[
"error1"
]
# 未登录的-校验
s
=
tractate_request
()
.
create_unlogin
()
s
=
json
.
loads
(
s
)
# r = json.loads(r)
# print(type(r))
assert
s
[
"message"
]
==
param
[
"message1"
]
test_backend_case/tractate_case/test_favor.py
View file @
ca5c338b
...
@@ -8,9 +8,9 @@ from all_backend_api.tractate_request import tractate_request
...
@@ -8,9 +8,9 @@ from all_backend_api.tractate_request import tractate_request
class
TestFavor
:
class
TestFavor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_FAVOR
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_FAVOR
)
test_case
,
test
_data
=
get_ids
(
data
,
"favor"
)
favor_case
,
favor
_data
=
get_ids
(
data
,
"favor"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
favor_data
,
ids
=
favor
_case
)
def
test_favor
(
self
,
param
):
def
test_favor
(
self
,
param
):
r
=
tractate_request
()
.
favor
(
param
[
"tractate_id"
],
param
[
"data_type"
])
r
=
tractate_request
()
.
favor
(
param
[
"tractate_id"
],
param
[
"data_type"
])
# print(r)
# print(r)
...
...
test_backend_case/tractate_case/test_publish_reply.py
View file @
ca5c338b
...
@@ -8,9 +8,9 @@ from all_backend_api.tractate_request import tractate_request
...
@@ -8,9 +8,9 @@ from all_backend_api.tractate_request import tractate_request
class
TestPublishReply
:
class
TestPublishReply
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_PUBLISH_REPLY
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_PUBLISH_REPLY
)
test_case
,
test
_data
=
get_ids
(
data
,
"publish_reply"
)
publishreply_case
,
publishreply
_data
=
get_ids
(
data
,
"publish_reply"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
publishreply_data
,
ids
=
publishreply
_case
)
def
test_publish_reply
(
self
,
param
):
def
test_publish_reply
(
self
,
param
):
r
=
tractate_request
()
.
publish_reply
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
],
param
[
"content"
])
r
=
tractate_request
()
.
publish_reply
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
],
param
[
"content"
])
# print(r)
# print(r)
...
...
test_backend_case/tractate_case/test_reply.py
View file @
ca5c338b
...
@@ -7,9 +7,9 @@ from all_backend_api.tractate_request import tractate_request
...
@@ -7,9 +7,9 @@ from all_backend_api.tractate_request import tractate_request
class
TestReply
:
class
TestReply
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_REPLY
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_REPLY
)
test_case
,
test
_data
=
get_ids
(
data
,
"reply"
)
reply_case
,
reply
_data
=
get_ids
(
data
,
"reply"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
reply_data
,
ids
=
reply
_case
)
def
test_reply
(
self
,
param
):
def
test_reply
(
self
,
param
):
r
=
tractate_request
()
.
reply
(
param
[
"current_city_id"
],
param
[
"id"
],
param
[
"data_type"
]
)
r
=
tractate_request
()
.
reply
(
param
[
"current_city_id"
],
param
[
"id"
],
param
[
"data_type"
]
)
# print(r)
# print(r)
...
...
test_backend_case/tractate_case/test_vote.py
View file @
ca5c338b
...
@@ -9,9 +9,9 @@ from all_backend_api.tractate_request import tractate_request
...
@@ -9,9 +9,9 @@ from all_backend_api.tractate_request import tractate_request
class
TestVote
:
class
TestVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_VOTE
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
TRACTATE_VOTE
)
test_case
,
test
_data
=
get_ids
(
data
,
"tractate_vote"
)
vote_case
,
vote
_data
=
get_ids
(
data
,
"tractate_vote"
)
@pytest.mark.parametrize
(
"param"
,
test_data
,
ids
=
test
_case
)
@pytest.mark.parametrize
(
"param"
,
vote_data
,
ids
=
vote
_case
)
def
test_vote
(
self
,
param
):
def
test_vote
(
self
,
param
):
r
=
tractate_request
()
.
tractate_detail
(
param
[
"current_city_id"
],
param
[
"tractate_id"
],
param
[
"data_type"
])
r
=
tractate_request
()
.
tractate_detail
(
param
[
"current_city_id"
],
param
[
"tractate_id"
],
param
[
"data_type"
])
if
r
[
"error"
]
==
0
:
if
r
[
"error"
]
==
0
:
...
@@ -22,12 +22,62 @@ class TestVote:
...
@@ -22,12 +22,62 @@ class TestVote:
assert
vote
[
"error"
]
==
0
assert
vote
[
"error"
]
==
0
assert
vote
[
"message"
]
==
param
[
"message1"
]
assert
vote
[
"message"
]
==
param
[
"message1"
]
# 取消点赞,回到取消点赞的状态
# 取消点赞,回到取消点赞的状态
canc
le
vote
=
tractate_request
()
.
tractate_cancelvote
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
])
canc
el
vote
=
tractate_request
()
.
tractate_cancelvote
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
])
assert
canc
le
vote
[
"error"
]
==
0
assert
canc
el
vote
[
"error"
]
==
0
else
:
else
:
# 如果是已经点过赞的状态就直接取消点赞
# 如果是已经点过赞的状态就直接取消点赞
canclevote
=
tractate_request
()
.
tractate_cancelvote
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
])
cancelvote
=
tractate_request
()
.
tractate_cancelvote
(
param
[
"tractate_id"
],
param
[
"data_type"
],
param
[
"reply_id"
])
assert
canclevote
[
"message"
]
==
param
[
"message2"
]
assert
cancelvote
[
"message"
]
==
param
[
"message2"
]
# r = tractate_request().tractate_detail(param["current_city_id"], param["tractate_id"], param["data_type"])
# if r["error"] == 0:
# assert r["error"] == param["assert1"]
# # 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
# if not r["data"]["tractate_list"]["is_voted"]:
# vote = tractate_request().tractate_vote(param["tractate_id"], param["data_type"], param["reply_id"])
# assert vote["error"] == 0
# assert vote["message"] == param["message"]
# print(param["position"])
# # # 取消点赞,回到取消点赞的状态
# # cancelvote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
# # assert cancelvote["error"] == 0
# elif param["position"] == 1:
# vote = tractate_request().tractate_vote(param["tractate_id"], param["data_type"], param["reply_id"])
# assert vote["error"] == 0
# assert vote["message"] == param["message"]
# print(param["position"])
# else:
# # 如果是已经点过赞的状态就直接取消点赞
# cancelvote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
# assert cancelvote["message"] == param["message"]
# print(param["position"])
...
...
test_backend_data/tractate_data/create.yaml
0 → 100644
View file @
ca5c338b
create
:
#发帖子--创建帖子页面接口校验
-
case
:
"
发帖子--创建帖子页面接口校验-"
current_city_id
:
"
beijiing"
error1
:
0
message1
:
"
请登录后再试"
test_backend_data/tractate_data/vote.yaml
View file @
ca5c338b
tractate_vote
:
tractate_vote
:
#贴子详情页点赞
#贴子详情页点赞----简单粗暴直接全部用写死的数据【不同帖子代表不同类型--并且把取消点赞接口迁移出去--指定输入-指定输出】
#position代表要用的是什么类型的case---不是必须有但有了比较好区分--从0开始【已废弃这个想法】
#技术水准有限拆不开,就写个点赞-二次点赞--取消点赞的闭环了;
-
-
case
:
"
贴子详情页--点赞
&取消点赞--用接口
校验"
case
:
"
贴子详情页--点赞
--二次点赞---取消点赞--
校验"
tractate_id
:
175152
tractate_id
:
175152
reply_id
:
"
"
reply_id
:
"
"
data_type
:
"
user_post"
data_type
:
"
user_post"
...
@@ -12,7 +15,7 @@ tractate_vote:
...
@@ -12,7 +15,7 @@ tractate_vote:
-
-
case
:
"
贴子详情页--一级评论点赞
&取消点赞--用接口
校验"
case
:
"
贴子详情页--一级评论点赞
--二次点赞--取消点赞--
校验"
tractate_id
:
175152
tractate_id
:
175152
reply_id
:
"
2167124"
reply_id
:
"
2167124"
data_type
:
"
user_post"
data_type
:
"
user_post"
...
@@ -22,3 +25,100 @@ tractate_vote:
...
@@ -22,3 +25,100 @@ tractate_vote:
message2
:
"
取消点赞成功"
message2
:
"
取消点赞成功"
# -
# case: "贴子详情页--点赞&取消点赞--用接口校验 --测试单纯点赞"
# tractate_id: 175152
# reply_id: ""
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "点赞成功"
# position: 0
# -
# case: "贴子详情页--点赞&取消点赞--用接口校验--二次点赞校验"
# tractate_id: 175152
# reply_id: ""
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "点赞成功"
# position: 1
# -
# case: "贴子详情页--点赞&取消点赞--用接口校验---取消点赞"
# tractate_id: 175152
# reply_id: ""
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "取消点赞成功"
# position: 2
##
# -
# case: "贴子详情页--一级评论点赞--用接口校验"
# tractate_id: 175152
# reply_id: "2167124"
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "点赞成功"
# position: 0
#
# -
# case: "贴子详情页--一级评论点赞--用接口校验"
# tractate_id: 175152
# reply_id: "2167124"
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "点赞成功"
# position: 1
#
#
# -
# case: "贴子详情页--一级评论取消点赞--用接口校验"
# tractate_id: 175152
# reply_id: "2167124"
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message: "取消点赞成功"
# position: 2
#
#
#
# case: "贴子详情页--一级评论点赞&取消点赞--用接口校验"
# tractate_id: 175152
# reply_id: "2167124"
# data_type: "user_post"
# current_city_id: "beijing"
# assert1: 0
# message1: "点赞成功"
# message2: "取消点赞成功"
#
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