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
e26521ab
Commit
e26521ab
authored
Jun 04, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日记本收藏&取消收藏
parent
decc614f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
176 additions
and
17 deletions
+176
-17
diary_cancelfavor.yaml
all_backend_api/diary_cancelfavor.yaml
+18
-0
diary_cancelfavor_request.py
all_backend_api/diary_cancelfavor_request.py
+16
-0
diary_data_request.py
all_backend_api/diary_data_request.py
+3
-3
diary_isfavor.yaml
all_backend_api/diary_isfavor.yaml
+18
-0
diary_isfavor_request.py
all_backend_api/diary_isfavor_request.py
+17
-0
diary_service_request.py
all_backend_api/diary_service_request.py
+1
-1
path_setting.py
path_setting.py
+9
-1
test_diary_data.py
test_backend_case/account_case/test_diary_data.py
+4
-7
test_diary_cancel.py
test_backend_case/diary_case/test_diary_cancel.py
+26
-0
test_diary_isfavor.py
test_backend_case/diary_case/test_diary_isfavor.py
+31
-0
test_diary_service.py
test_backend_case/diary_case/test_diary_service.py
+5
-5
diary_cancelfavor.yaml
test_backend_data/diary/diary_cancelfavor.yaml
+14
-0
diary_isfavor.yaml
test_backend_data/diary/diary_isfavor.yaml
+14
-0
No files found.
all_backend_api/diary_cancelfavor.yaml
0 → 100644
View file @
e26521ab
#日记本收藏
cancelfavor
:
method
:
delete
url
:
/api/diary/favor/17586195
params
:
data
:
{}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
all_backend_api/diary_cancelfavor_request.py
0 → 100644
View file @
e26521ab
import
path_setting
from
in_common.base_request
import
BaseRequest
class
diary_cancelfavor_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
DIARY_CANCELFAVOR_CONFIG
)
def
diary_cancelfavor
(
self
):
return
self
.
api_send
(
self
.
data
[
"cancelfavor"
])
all_backend_api/diary_data_request.py
View file @
e26521ab
from
backend_auto
import
path_setting
from
backend_auto.
in_common.base_request
import
BaseRequest
import
path_setting
from
in_common.base_request
import
BaseRequest
class
diary_data_reqest
(
BaseRequest
):
class
diary_data_req
u
est
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
DIARY_DATA_CONFIG
)
...
...
all_backend_api/diary_isfavor.yaml
0 → 100644
View file @
e26521ab
#日记本收藏
isfavor
:
method
:
post
url
:
/api/diary/favor/17586195
params
:
data
:
{}
json
:
{}
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
all_backend_api/diary_isfavor_request.py
0 → 100644
View file @
e26521ab
import
path_setting
from
in_common.base_request
import
BaseRequest
class
diary_isfavor_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
DIARY_ISFAVOR_CONFIG
)
def
diary_isfavor
(
self
):
return
self
.
api_send
(
self
.
data
[
"isfavor"
])
all_backend_api/diary_service_request.py
View file @
e26521ab
...
...
@@ -2,7 +2,7 @@ import path_setting
from
in_common.base_request
import
BaseRequest
class
diary_service_reqest
(
BaseRequest
):
class
diary_service_req
u
est
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
DIARY_SERVICE_CONFIG
)
...
...
path_setting.py
View file @
e26521ab
...
...
@@ -13,9 +13,17 @@ DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diar
DIARY_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"diary_data.yaml"
)
#日记本关联美购
DIARY_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_service
_request
.yaml"
)
DIARY_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_service.yaml"
)
DIARY_SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary"
,
"diary_service.yaml"
)
#日记本收藏
DIARY_ISFAVOR_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_isfavor.yaml"
)
DIARY_ISFAVOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary"
,
"diary_isfavor.yaml"
)
# 日记本取消收藏
DIARY_CANCELFAVOR_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_cancelfavor.yaml"
)
DIARY_CANCELFAVOR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/diary"
,
"diary_cancelfavor.yaml"
)
#搜索首页-热门搜索
KEYWORDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
...
...
test_backend_case/account_case/test_diary_data.py
View file @
e26521ab
...
...
@@ -3,18 +3,18 @@ import pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_data_request
import
diary_data_reqest
from
all_backend_api.diary_data_request
import
diary_data_req
u
est
class
TestD
IARYDATA
:
class
TestD
iaryData
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_DATA
)
diary_data_case
,
diary_data_data
=
get_ids
(
data
,
"diary_data"
)
@pytest.mark.parametrize
(
"param"
,
diary_data_data
,
ids
=
diary_data_case
)
def
test_diary_data
(
self
,
param
):
# print(2)
r
=
diary_data_reqest
()
.
diary_data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num"
])
# print(
1
)
r
=
diary_data_req
u
est
()
.
diary_data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num"
])
# print(
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
...
...
@@ -38,6 +38,3 @@ class TestDIARYDATA:
if
r
[
"error"
]
==
1
:
assert
r
[
"error"
]
==
param
[
"assert"
]
test_backend_case/diary_case/test_diary_cancel.py
0 → 100644
View file @
e26521ab
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_cancelfavor_request
import
diary_cancelfavor_request
class
TestDiaryCancelfavor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_CANCELFAVOR
)
diary_cancelfavor_case
,
diary_cancelfavor_data
=
get_ids
(
data
,
"diary_cancelfavor"
)
@pytest.mark.parametrize
(
"param"
,
diary_cancelfavor_data
,
ids
=
diary_cancelfavor_case
)
def
test_diary_cancelfavor
(
self
,
param
):
r
=
diary_cancelfavor_request
()
.
diary_cancelfavor
()
# print(r)
if
r
[
"error"
]
==
0
:
assert
r
[
"message"
]
==
param
[
"assert"
]
assert
r
[
"message"
]
==
param
[
"assert2"
]
test_backend_case/diary_case/test_diary_isfavor.py
0 → 100644
View file @
e26521ab
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_isfavor_request
import
diary_isfavor_request
class
TestDiaryIsfavor
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_ISFAVOR
)
diary_isfavor_case
,
diary_isfavor_data
=
get_ids
(
data
,
"diary_isfavor"
)
@pytest.mark.parametrize
(
"param"
,
diary_isfavor_data
,
ids
=
diary_isfavor_case
)
def
test_diary_isfavor
(
self
,
param
):
r
=
diary_isfavor_request
()
.
diary_isfavor
()
# print(r)
if
r
[
"error"
]
==
0
:
assert
r
[
"message"
]
==
param
[
"assert"
]
assert
r
[
"message"
]
==
param
[
"assert2"
]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
test_backend_case/diary_case/test_diary_service.py
View file @
e26521ab
...
...
@@ -3,18 +3,18 @@ import pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.diary_data_request
import
diary_data_reqest
from
all_backend_api.diary_data_request
import
diary_data_req
u
est
class
TestD
IARYDATA
:
class
TestD
iaryService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DIARY_DATA
)
diary_data_case
,
diary_data_data
=
get_ids
(
data
,
"diary_data"
)
@pytest.mark.parametrize
(
"param"
,
diary_data_data
,
ids
=
diary_data_case
)
def
test_diary_
data
(
self
,
param
):
def
test_diary_
service
(
self
,
param
):
# print(2)
r
=
diary_data_reqest
()
.
diary_data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num"
])
# print(
1
)
r
=
diary_data_req
u
est
()
.
diary_data
(
param
[
"current_city_id"
],
param
[
"diary_referrer"
],
param
[
"sort"
],
param
[
"count"
],
param
[
"start_num"
])
# print(
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
...
...
test_backend_data/diary/diary_cancelfavor.yaml
0 → 100644
View file @
e26521ab
diary_cancelfavor
:
#取消收藏case--无须字段
-
case
:
"
取消收藏成功case"
assert
:
"
已取消收藏"
assert2
:
"
请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
test_backend_data/diary/diary_isfavor.yaml
0 → 100644
View file @
e26521ab
diary_isfavor
:
#收藏case--无须字段
-
case
:
"
收藏成功case"
assert
:
"
收藏成功"
assert2
:
"
请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
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