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
c5603cc1
Commit
c5603cc1
authored
Jul 30, 2021
by
edz
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
76bd138f
f22e8432
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
328 additions
and
14 deletions
+328
-14
diary_request.py
all_backend_api/diary_request.py
+8
-0
diary_request.yaml
all_backend_api/diary_request.yaml
+22
-0
janus_request.py
all_backend_api/janus_request.py
+13
-0
janus_request.yaml
all_backend_api/janus_request.yaml
+17
-2
query_request.py
all_backend_api/query_request.py
+13
-0
query_request.yaml
all_backend_api/query_request.yaml
+11
-0
path_setting.py
path_setting.py
+12
-1
test_update.py
test_backend_case/diary_case/test_update.py
+0
-5
test_vote.py
test_backend_case/diary_case/test_vote.py
+37
-0
test_api_topic_vote.py
test_backend_case/hybrid_case/test_api_topic_vote.py
+1
-1
test_sales_lead_spu_by_diary.py
test_backend_case/janus_case/test_sales_lead_spu_by_diary.py
+22
-0
__init__.py
test_backend_case/query_case/__init__.py
+0
-0
test_preset_words.py
test_backend_case/query_case/test_preset_words.py
+34
-0
vote.yaml
test_backend_data/diary_data/vote.yaml
+15
-0
api_topic_vote.yaml
test_backend_data/hybrid_data/api_topic_vote.yaml
+1
-1
sales_lead_spu_by_diary.yaml
test_backend_data/janus_data/sales_lead_spu_by_diary.yaml
+15
-0
__init__.py
test_backend_data/query_data/__init__.py
+0
-0
preset_words.yaml
test_backend_data/query_data/preset_words.yaml
+107
-0
topic_reply_create.yaml
test_backend_data/topic_data/topic_reply_create.yaml
+0
-4
No files found.
all_backend_api/diary_request.py
View file @
c5603cc1
...
...
@@ -47,4 +47,12 @@ class diary_request(BaseRequest):
self
.
params
[
"topic_list"
]
=
topic_list
return
self
.
api_send
(
self
.
data
[
"update"
])
# 日记本卡片点赞
def
diary_vote
(
self
,
diary_id
):
self
.
params
[
"diary_id"
]
=
diary_id
return
self
.
api_send
(
self
.
data
[
"vote"
])
# 日记本卡片取消点赞
def
diary_cancel_vote
(
self
,
diary_id
):
self
.
params
[
"diary_id"
]
=
diary_id
return
self
.
api_send
(
self
.
data
[
"cancel_vote"
])
all_backend_api/diary_request.yaml
View file @
c5603cc1
...
...
@@ -78,3 +78,25 @@ update:
topic_list
:
${topic_list}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本卡片的点赞
vote
:
method
:
post
url
:
/api/diary/vote
params
:
data
:
diary_id
:
${diary_id}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本卡片的取消点赞
cancel_vote
:
method
:
post
url
:
/api/diary/cancel_vote
params
:
data
:
diary_id
:
${diary_id}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
all_backend_api/janus_request.py
View file @
c5603cc1
...
...
@@ -248,6 +248,19 @@ class janus_request(BaseRequest):
self
.
params
[
"rosy"
]
=
rosy
return
self
.
api_send
(
self
.
data
[
"beauty_post"
])
# 日记点击大图--关联美购--除了id外其余用默认参数代替
def
sales_lead_spu_by_diary
(
self
,
diary_id
,
current_city_id
=
'beijing'
,
device_id
=
'91B499C2-1CA2-4CB2-F118-658C87BC1795'
,
lat
=
'39.98318403526738'
,
lng
=
'116.4880823948151'
):
self
.
params
[
"diary_id"
]
=
diary_id
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"device_id"
]
=
device_id
self
.
params
[
"lat"
]
=
lat
self
.
params
[
"lng"
]
=
lng
return
self
.
api_send
(
self
.
data
[
"sales_lead_spu_by_diary"
])
#
if
__name__
==
'__main__'
:
...
...
all_backend_api/janus_request.yaml
View file @
c5603cc1
...
...
@@ -340,4 +340,19 @@ beauty_post:
white
:
${white}
rosy
:
${rosy}
json
:
{}
isLogin
:
1
\ No newline at end of file
isLogin
:
1
#日记点击大图--关联美购--除了id外其余用默认参数代替
sales_lead_spu_by_diary
:
method
:
get
url
:
/api/janus/sales_lead/spu_by_diary
params
:
diary_id
:
${diary_id}
current_city_id
:
${current_city_id}
device_id
:
${device_id}
lat
:
${lat}
lng
:
${lng}
data
:
{}
json
:
{}
isLogin
:
0
\ No newline at end of file
all_backend_api/query_request.py
0 → 100644
View file @
c5603cc1
import
path_setting
from
in_common.base_request
import
BaseRequest
class
query_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
QUERY_CONFIG
)
# 详情页预置词
def
preset_words
(
self
,
id
,
type
):
self
.
params
[
"id"
]
=
id
self
.
params
[
"type"
]
=
type
return
self
.
api_send
(
self
.
data
[
"preset_words"
])
all_backend_api/query_request.yaml
0 → 100644
View file @
c5603cc1
#详情页预置词
preset_words
:
method
:
get
url
:
/api/query/preset_words
params
:
id
:
${id}
type
:
${type}
data
:
json
:
{}
isLogin
:
0
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
path_setting.py
View file @
c5603cc1
...
...
@@ -22,6 +22,8 @@ DIARY_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data"
DIARY_OPERATION
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary_data"
,
"diary_operation.yaml"
)
# 日记本创建日记贴信息-
DIARY_UPDATE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary_data"
,
"diary_update.yaml"
)
# 日记本点赞&取消点赞
DIARY_VOTE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary_data"
,
"vote.yaml"
)
# 日记本创建添加医院-- auto_complete 总配置项
...
...
@@ -31,6 +33,15 @@ AUTO_COMPLE_HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/au
AUTO_COMPLE_DOCTOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/auto_complete_data"
,
"doctor.yaml"
)
# 详情页搜索预置词--query 总配置项
QUERY_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"query_request.yaml"
)
QUERY_PRESET_WORDS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/query_data"
,
"preset_words.yaml"
)
# 日记大图召回美购
SPU_BY_DIARY
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"sales_lead_spu_by_diary.yaml"
)
# 日记本进入相册页
DIARY_ALBUM_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hybrid_diary_request.yaml"
)
DIARY_ALBUM
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_data"
,
"diary_album.yaml"
)
...
...
@@ -38,7 +49,7 @@ DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data
# 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"hybrid_api_topic_request.yaml"
)
DIARY_VOTE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_data"
,
"api_topic_vote.yaml"
)
DIARY_
TOPIC_
VOTE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/hybrid_data"
,
"api_topic_vote.yaml"
)
# 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容
...
...
test_backend_case/diary_case/test_update.py
View file @
c5603cc1
...
...
@@ -13,15 +13,10 @@ class TestDiaryUpdate:
@pytest.mark.parametrize
(
"param"
,
diary_update_data
,
ids
=
diary_update_case
)
def
test_diary_update
(
self
,
param
):
r
=
diary_request
()
.
diary_update
(
param
[
"topic_list"
])
# print(r)
# if r["error"] == 0:
# assert r["message"] == param["assert"]
if
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
param
[
"message"
]
# 校验--如果是因为发布频繁导致的错误就不用理会-如果是其他再判断
# 收藏之后取消收藏?为啥能成功?
...
...
test_backend_case/diary_case/test_vote.py
0 → 100644
View file @
c5603cc1
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_request
import
diary_request
class
TestVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_VOTE
)
diary_vote_case
,
diary_vote_data
=
get_ids
(
data
,
"diary_vote"
)
@pytest.mark.parametrize
(
"param"
,
diary_vote_data
,
ids
=
diary_vote_case
)
def
test_vote
(
self
,
param
):
r
=
diary_request
()
.
diary_vote
(
param
[
"diary_id"
])
# 如果点赞成功,就走取消点赞的流程,否则先取消点赞再去点赞
if
r
[
"message"
]
==
param
[
"assert2"
]:
# 之后取消点赞。【最后保持取消点赞的状态】
cancel_vote
=
diary_request
()
.
diary_cancel_vote
(
param
[
"diary_id"
])
assert
cancel_vote
[
"error"
]
==
0
else
:
# 如果是已经点过赞的状态就直接取消点赞,然后再走一遍点赞-取消点赞;一般不走这边除非手动点过这个卡片
assert
r
[
"message"
]
==
param
[
"assert3"
]
cancel_vote
=
diary_request
()
.
diary_cancel_vote
(
param
[
"diary_id"
])
assert
cancel_vote
[
"error"
]
==
0
vote
=
diary_request
()
.
diary_vote
(
param
[
"diary_id"
])
assert
vote
[
"message"
]
==
param
[
"assert2"
]
cancel_vote
=
diary_request
()
.
diary_cancel_vote
(
param
[
"diary_id"
])
assert
cancel_vote
[
"error"
]
==
0
test_backend_case/hybrid_case/test_api_topic_vote.py
View file @
c5603cc1
...
...
@@ -7,7 +7,7 @@ from all_backend_api.hybrid_api_topic_request import hybrid_api_topic_request
class
TestDiaryVote
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_VOTE
)
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_
TOPIC_
VOTE
)
diary_vote_case
,
diary_vote_data
=
get_ids
(
data
,
"diary_vote"
)
@pytest.mark.parametrize
(
"param"
,
diary_vote_data
,
ids
=
diary_vote_case
)
...
...
test_backend_case/janus_case/test_sales_lead_spu_by_diary.py
0 → 100644
View file @
c5603cc1
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
all_backend_api.janus_request
import
janus_request
from
in_common.base_request
import
BaseRequest
class
TestSalesLeadSpuByDiary
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SPU_BY_DIARY
)
sales_lead_spu_by_diary_case
,
sales_lead_spu_by_diary_data
=
get_ids
(
data
,
"sales_lead_spu_by_diary"
)
@pytest.mark.parametrize
(
"param"
,
sales_lead_spu_by_diary_data
,
ids
=
sales_lead_spu_by_diary_case
)
def
test_sales_lead_spu_by_diary
(
self
,
param
):
r
=
janus_request
()
.
sales_lead_spu_by_diary
(
param
[
"diary_id"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
if
param
[
"spu_info"
]
==
1
:
assert
r
[
"data"
][
"spu_info"
]
else
:
assert
r
[
"data"
][
"spu_info"
]
is
None
test_backend_case/query_case/__init__.py
0 → 100644
View file @
c5603cc1
test_backend_case/query_case/test_preset_words.py
0 → 100644
View file @
c5603cc1
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.query_request
import
query_request
class
TestPresetWords
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
QUERY_PRESET_WORDS
)
preset_words_case
,
preset_words_data
=
get_ids
(
data
,
"preset_words"
)
@pytest.mark.parametrize
(
"param"
,
preset_words_data
,
ids
=
preset_words_case
)
def
test_PresetWords
(
self
,
param
):
r
=
query_request
()
.
preset_words
(
param
[
"id"
],
param
[
"type"
])
# 因问答详情页接口返回不一样所以加了个标示位
key
=
"is_question_answer"
if
param
[
"is_preset_words"
]
==
1
:
assert
len
(
r
[
"data"
][
"tags"
])
==
param
[
"len"
]
else
:
if
key
in
param
.
keys
():
assert
len
(
r
[
"data"
][
"tags"
])
==
param
[
"len"
]
else
:
assert
len
(
r
[
"data"
])
==
param
[
"len"
]
test_backend_data/diary_data/vote.yaml
0 → 100644
View file @
c5603cc1
diary_vote
:
#点赞case--从日记本卡片对日记本点赞
-
case
:
"
日记本卡片点赞日记本--点赞&取消点赞成功case--校验"
diary_id
:
17586091
assert1
:
assert2
:
"
美
+1"
assert3
:
"
已经赞过啦"
test_backend_data/hybrid_data/api_topic_vote.yaml
View file @
c5603cc1
diary_vote
:
#点赞case--从日记本列表点赞
-
case
:
"
日记本列表点赞--点赞&取消点赞成功case--校验"
case
:
"
日记本列表点赞
日记贴
--点赞&取消点赞成功case--校验"
id
:
21249958
topic_id
:
21249958
assert1
:
0
...
...
test_backend_data/janus_data/sales_lead_spu_by_diary.yaml
0 → 100644
View file @
c5603cc1
# 日记本大图关联美购--其实和日记本关联的美购一致
# 用spu_info来作为标示位
# id 是必传项
sales_lead_spu_by_diary
:
-
case
:
"
日记本大图关联美购--存在美购"
diary_id
:
15261339
spu_info
:
1
assert
:
0
-
case
:
"
日记本大图关联美购--不存在美购"
diary_id
:
17586195
spu_info
:
null
assert
:
0
\ No newline at end of file
test_backend_data/query_data/__init__.py
0 → 100644
View file @
c5603cc1
test_backend_data/query_data/preset_words.yaml
0 → 100644
View file @
c5603cc1
preset_words
:
#详情页预置词
#is_preset_words 用来case判断有没有预置词,因为两个的判定条件不一样,这样写简单点
# is_question_answer 问答详情页的单独标示位
-
case
:
"
不存在预置词--日记本详情页--校验"
id
:
17586091
type
:
1
len
:
0
is_preset_words
:
0
-
case
:
"
存在一个预置词--日记本详情页--校验"
id
:
15714021
type
:
1
len
:
1
is_preset_words
:
1
-
case
:
"
存在两个预置词--日记本详情页--校验"
id
:
17004877
type
:
1
len
:
2
is_preset_words
:
1
-
case
:
"
不存在预置词--日记贴详情页--校验"
id
:
123456954
type
:
2
len
:
0
is_preset_words
:
0
-
case
:
"
存在一个预置词--日记贴详情页--校验"
id
:
21129553
type
:
2
len
:
1
is_preset_words
:
1
-
case
:
"
存在两个预置词--日记贴详情页--校验"
id
:
21149097
type
:
2
len
:
2
is_preset_words
:
1
-
case
:
"
不存在预置词--问答详情页--校验---单独校验这个返回方式和别的不一样"
id
:
357125
type
:
3
len
:
0
is_preset_words
:
0
is_question_answer
:
1
-
case
:
"
存在一个预置词--问答详情页--校验"
id
:
181212
type
:
3
len
:
1
is_preset_words
:
1
-
case
:
"
存在两个预置词--问答详情页--校验"
id
:
124225
type
:
3
len
:
2
is_preset_words
:
1
-
case
:
"
不存在预置词--回答详情页--校验"
id
:
1008579
type
:
4
len
:
0
is_preset_words
:
0
-
case
:
"
存在一个预置词--回答详情页--校验"
id
:
246245
type
:
4
len
:
1
is_preset_words
:
1
-
case
:
"
存在两个预置词--回答详情页--校验"
id
:
867689
type
:
4
len
:
2
is_preset_words
:
1
-
case
:
"
不存在预置词--帖子详情页--校验"
id
:
187937
type
:
5
len
:
0
is_preset_words
:
0
-
case
:
"
存在一个预置词--帖子详情页--校验"
id
:
44534
type
:
5
len
:
1
is_preset_words
:
1
-
case
:
"
存在两个预置词--帖子详情页--校验"
id
:
172774
type
:
5
len
:
2
is_preset_words
:
1
test_backend_data/topic_data/topic_reply_create.yaml
View file @
c5603cc1
...
...
@@ -3,11 +3,7 @@ reply_create:
beuzhu
:
'
#
备注:
这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case
:
日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel
:
benzhan
<<<<<<< Updated upstream
content
:
ces测试+2021-07-28 19:16:19
=======
content
:
ces测试+2021-07-26 18:10:54
>
>>>>>>
Stashed
changes
message
:
请勿回复重复内容
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