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
b64eaf49
Commit
b64eaf49
authored
May 27, 2021
by
刘婷婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交脚本
parent
9276828b
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
169 additions
and
0 deletions
+169
-0
answer_request.py
all_backend_api/answer_request.py
+24
-0
answer_request.yaml
all_backend_api/answer_request.yaml
+33
-0
question_request.py
all_backend_api/question_request.py
+17
-0
question_request.yaml
all_backend_api/question_request.yaml
+13
-0
test_cancel_vote.py
test_backend_case/answer_case/test_cancel_vote.py
+16
-0
test_vote.py
test_backend_case/answer_case/test_vote.py
+16
-0
__init__.py
test_backend_case/question_case/__init__.py
+2
-0
test_reply_answer.py
test_backend_case/question_case/test_reply_answer.py
+16
-0
__init__.py
test_backend_data/answer_data/__init__.py
+2
-0
cancel_vote.yaml
test_backend_data/answer_data/cancel_vote.yaml
+6
-0
detail.yaml
test_backend_data/answer_data/detail.yaml
+8
-0
vote.yaml
test_backend_data/answer_data/vote.yaml
+5
-0
__init__.py
test_backend_data/question_data/__init__.py
+2
-0
reply_answer.yaml
test_backend_data/question_data/reply_answer.yaml
+9
-0
No files found.
all_backend_api/answer_request.py
0 → 100644
View file @
b64eaf49
import
path_setting
from
in_common.base_request
import
BaseRequest
class
answer_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
abc
=
self
.
api_load
(
path_setting
.
DETAIL_CONFIG
)
print
(
self
.
data
)
# 回答详情页
def
detail
(
self
,
current_city_id
,
answer_id
=
""
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"answer_id"
]
=
answer_id
return
self
.
api_send
(
self
.
abc
[
"detail"
])
# 回答详情页点赞
def
vote
(
self
,
answer_id
=
""
):
self
.
params
[
"answer_id"
]
=
answer_id
return
self
.
api_send
(
self
.
abc
[
"vote"
])
# 回答详情页取消点赞
def
cancel_vote
(
self
,
answer_id
=
""
):
self
.
params
[
"answer_id"
]
=
answer_id
return
self
.
api_send
(
self
.
abc
[
"cancel_vote"
])
all_backend_api/answer_request.yaml
0 → 100644
View file @
b64eaf49
#回答详情页
detail
:
method
:
get
url
:
/api/answer/detail
params
:
current_city_id
:
${current_city_id}
data
:
answer_id
:
${answer_id}
json
:
{}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#回答详情页——点赞
vote
:
method
:
post
url
:
/api/answer/vote
params
:
current_city_id
:
${current_city_id}
data
:
answer_id
:
${answer_id}
json
:
{}
isLogin
:
1
#回答详情页——取消点赞
cancel_vote
:
method
:
post
url
:
/api/answer/cancel_vote
params
:
current_city_id
:
${current_city_id}
data
:
answer_id
:
${answer_id}
json
:
{}
isLogin
:
1
all_backend_api/question_request.py
0 → 100644
View file @
b64eaf49
import
path_setting
from
in_common.base_request
import
BaseRequest
class
question_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
replyanswer
=
self
.
api_load
(
path_setting
.
QUESTION_CONFIG
)
print
(
self
.
data
)
# 回答详情页- 一/二级评论
def
reply_answer
(
self
,
current_city_id
,
answer_id
,
content
,
user_id
=
""
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"answer_id"
]
=
answer_id
self
.
params
[
"content"
]
=
content
self
.
params
[
"user_id"
]
=
user_id
return
self
.
api_send
(
self
.
replyanswer
[
"reply_answer"
])
all_backend_api/question_request.yaml
0 → 100644
View file @
b64eaf49
#回答详情页- 一/二级评论
reply_answer
:
method
:
post
url
:
/api/question/reply_answer
params
:
current_city_id
:
${current_city_id}
data
:
answer_id
:
${answer_id}
content
:
${content}
user_id
:
${user_id}
json
:
{}
isLogin
:
1
\ No newline at end of file
test_backend_case/answer_case/test_cancel_vote.py
0 → 100644
View file @
b64eaf49
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.answer_request
import
answer_request
class
TestCancelVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CANCEL_VOTE
)
cancelvote_case
,
cancelvote_data
=
get_ids
(
data
,
"cancel_vote"
)
@pytest.mark.parametrize
(
"param"
,
cancelvote_data
,
ids
=
cancelvote_case
)
def
test_cancel_vote
(
self
,
param
):
r
=
answer_request
()
.
cancel_vote
(
param
[
"answer_id"
])
if
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
param
[
"assert"
]
test_backend_case/answer_case/test_vote.py
0 → 100644
View file @
b64eaf49
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.answer_request
import
answer_request
class
TestVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
VOTE
)
vote_case
,
vote_data
=
get_ids
(
data
,
"vote"
)
@pytest.mark.parametrize
(
"param"
,
vote_data
,
ids
=
vote_case
)
def
test_vote
(
self
,
param
):
r
=
answer_request
()
.
vote
(
param
[
"answer_id"
])
if
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
param
[
"assert"
]
test_backend_case/question_case/__init__.py
0 → 100644
View file @
b64eaf49
#!/usr/bin/env python
# -*- coding:utf-8 -*-
test_backend_case/question_case/test_reply_answer.py
0 → 100644
View file @
b64eaf49
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.question_request
import
question_request
class
TestReplyAnswer
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
REPLY_ANSWER
)
replyanswer_case
,
replyanswer_data
=
get_ids
(
data
,
"reply_answer"
)
@pytest.mark.parametrize
(
"param"
,
replyanswer_data
,
ids
=
replyanswer_case
)
def
test_reply_answer
(
self
,
param
):
r
=
question_request
()
.
reply_answer
(
param
[
"current_city_id"
],
param
[
"answer_id"
],
param
[
"content"
],
param
[
"user_id"
])
if
r
[
"message"
]
==
"操作成功"
:
assert
r
[
"message"
]
==
param
[
"assert"
]
test_backend_data/answer_data/__init__.py
0 → 100644
View file @
b64eaf49
#!/usr/bin/env python
# -*- coding:utf-8 -*-
test_backend_data/answer_data/cancel_vote.yaml
0 → 100644
View file @
b64eaf49
cancel_vote
:
-
case
:
"
接口正常case"
current_city_id
:
"
beijing"
answer_id
:
"
868312"
assert
:
"
"
test_backend_data/answer_data/detail.yaml
0 → 100644
View file @
b64eaf49
detail
:
#字段正常case
-
case
:
"
接口正常case"
current_city_id
:
"
beijing"
answer_id
:
"
868312"
assert
:
"
"
test_backend_data/answer_data/vote.yaml
0 → 100644
View file @
b64eaf49
vote
:
-
case
:
"
接口正常case"
answer_id
:
"
868312"
assert
:
"
"
test_backend_data/question_data/__init__.py
0 → 100644
View file @
b64eaf49
#!/usr/bin/env python
# -*- coding:utf-8 -*-
test_backend_data/question_data/reply_answer.yaml
0 → 100644
View file @
b64eaf49
reply_answer
:
-
case
:
"
接口正常case"
current_city_id
:
"
beijing"
answer_id
:
"
868312"
content
:
"
长知识了"
user_id
:
"
33910245"
assert
:
"
操作成功"
extra
:
{}
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