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
e4459b3c
Commit
e4459b3c
authored
Aug 13, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增签到相关
parent
c46c29eb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
136 additions
and
6 deletions
+136
-6
user_request.py
all_backend_api/user_request.py
+18
-6
user_request.yaml
all_backend_api/user_request.yaml
+30
-0
path_setting.py
path_setting.py
+8
-0
test_base_sign_data.py
test_backend_case/user_case/test_base_sign_data.py
+27
-0
test_sign_calendar.py
test_backend_case/user_case/test_sign_calendar.py
+17
-0
test_sign_exchanged.py
test_backend_case/user_case/test_sign_exchanged.py
+21
-0
base_sign_data.yaml
test_backend_data/user_data/base_sign_data.yaml
+5
-0
sign_calendar.yaml
test_backend_data/user_data/sign_calendar.yaml
+5
-0
sign_exchanged.yaml
test_backend_data/user_data/sign_exchanged.yaml
+5
-0
No files found.
all_backend_api/user_request.py
View file @
e4459b3c
...
@@ -23,10 +23,11 @@ class user_request(BaseRequest):
...
@@ -23,10 +23,11 @@ class user_request(BaseRequest):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
TOPIC_FAVOR_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
TOPIC_FAVOR_CONFIG
)
#日记贴帖子相关-收藏
#
日记贴帖子相关-收藏
def
topic_favor
(
self
):
def
topic_favor
(
self
):
return
self
.
api_send
(
self
.
data
[
"favor"
])
return
self
.
api_send
(
self
.
data
[
"favor"
])
#日记贴取消收藏
# 日记贴取消收藏
def
topic_canclefavor
(
self
):
def
topic_canclefavor
(
self
):
return
self
.
api_send
(
self
.
data
[
"canclefavor"
])
return
self
.
api_send
(
self
.
data
[
"canclefavor"
])
...
@@ -36,7 +37,7 @@ class user_request(BaseRequest):
...
@@ -36,7 +37,7 @@ class user_request(BaseRequest):
self
.
params
[
"from_live"
]
=
from_live
self
.
params
[
"from_live"
]
=
from_live
return
self
.
api_send
(
self
.
data
[
'follow_add'
])
return
self
.
api_send
(
self
.
data
[
'follow_add'
])
#取消关注
#
取消关注
def
follow_del
(
self
,
uid
,
from_live
):
def
follow_del
(
self
,
uid
,
from_live
):
self
.
params
[
"uid"
]
=
uid
self
.
params
[
"uid"
]
=
uid
self
.
params
[
"from_live"
]
=
from_live
self
.
params
[
"from_live"
]
=
from_live
...
@@ -45,14 +46,12 @@ class user_request(BaseRequest):
...
@@ -45,14 +46,12 @@ class user_request(BaseRequest):
#我的-日记
#
我的-日记
def
my_diary_v2
(
self
,
start_num
,
count
):
def
my_diary_v2
(
self
,
start_num
,
count
):
self
.
params
[
"start_num"
]
=
start_num
self
.
params
[
"start_num"
]
=
start_num
self
.
params
[
"count"
]
=
count
self
.
params
[
"count"
]
=
count
return
self
.
api_send
(
self
.
data
[
"my_diary_v2"
])
return
self
.
api_send
(
self
.
data
[
"my_diary_v2"
])
# 我的-帖子-我发布的
# 我的-帖子-我发布的
...
@@ -119,6 +118,19 @@ class user_request(BaseRequest):
...
@@ -119,6 +118,19 @@ class user_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"favors_topics"
])
return
self
.
api_send
(
self
.
data
[
"favors_topics"
])
# 签到--签到基础信息
def
base_sign_data
(
self
):
return
self
.
api_send
(
self
.
data
[
"base_sign_data"
])
# 签到--签到兑换记录
def
sign_exchanged
(
self
):
return
self
.
api_send
(
self
.
data
[
"sign_exchanged"
])
# 签到--日历
def
sign_calendar
(
self
,
year
=
'2021'
,
month
=
'8'
):
self
.
params
[
"year"
]
=
year
self
.
params
[
"month"
]
=
month
return
self
.
api_send
(
self
.
data
[
"sign_calendar"
])
...
...
all_backend_api/user_request.yaml
View file @
e4459b3c
...
@@ -157,3 +157,33 @@ favors_topics:
...
@@ -157,3 +157,33 @@ favors_topics:
isLogin
:
1
isLogin
:
1
#签到--基础信息
base_sign_data
:
method
:
GET
url
:
/api/user/base_sign_data
params
:
data
:
{}
json
:
{}
isLogin
:
1
#签到--奖品兑换记录
sign_exchanged
:
method
:
GET
url
:
/api/user/sign_exchanged
params
:
data
:
{}
json
:
{}
isLogin
:
1
#签到--日历
sign_calendar
:
method
:
GET
url
:
/api/user/sign_calendar
params
:
year
:
${year}
month
:
${month}
data
:
{}
json
:
{}
isLogin
:
1
path_setting.py
View file @
e4459b3c
...
@@ -148,6 +148,14 @@ FEED_TAB_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_
...
@@ -148,6 +148,14 @@ FEED_TAB_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_
FEED_TAB_SERVICE_DOCTORS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/service_data"
,
"home_feed.yaml"
)
FEED_TAB_SERVICE_DOCTORS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/service_data"
,
"home_feed.yaml"
)
# 签到接口
SIGN
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"base_sign_data.yaml"
)
# 签到兑换记录
SIGN_EXCHANGED
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"sign_exchanged.yaml"
)
# 签到日历
SIGN_CALENDAR
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"sign_calendar.yaml"
)
#搜索首页-热门搜索
#搜索首页-热门搜索
KEYWORDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
KEYWORDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
KEYWORDS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"keywords.yaml"
)
KEYWORDS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"keywords.yaml"
)
...
...
test_backend_case/user_case/test_base_sign_data.py
0 → 100644
View file @
e4459b3c
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.user_request
import
user_request
class
TestBaseSignData
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SIGN
)
base_sign_data_case
,
base_sign_data_data
=
get_ids
(
data
,
"base_sign_data"
)
@pytest.mark.parametrize
(
"param"
,
base_sign_data_data
,
ids
=
base_sign_data_case
)
def
test_favors_diaries
(
self
,
param
):
r
=
user_request
()
.
base_sign_data
()
assert
r
[
"error"
]
==
param
[
"assert"
]
# 校验字段是否存在
# print(r["data"])
assert
r
[
"data"
][
"wait_time"
]
is
not
None
and
r
[
"data"
][
"wait_time"
]
is
not
""
# 是否关注
assert
r
[
"data"
][
"new_user"
]
is
not
None
and
r
[
"data"
][
"new_user"
]
is
not
""
# 是否关注
assert
r
[
"data"
][
"sign_status"
]
is
not
None
and
r
[
"data"
][
"sign_status"
]
is
not
""
# 是否关注
assert
r
[
"data"
][
"user_id"
]
is
not
None
and
r
[
"data"
][
"user_id"
]
is
not
""
# 是否关注
assert
r
[
"data"
][
"days_to_gift"
]
is
not
None
and
r
[
"data"
][
"days_to_gift"
]
is
not
""
# 是否关注
# assert r["data"] is True
test_backend_case/user_case/test_sign_calendar.py
0 → 100644
View file @
e4459b3c
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.user_request
import
user_request
class
TestSignCalendar
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SIGN_CALENDAR
)
sign_calendar_case
,
sign_calendar_data
=
get_ids
(
data
,
"sign_calendar"
)
@pytest.mark.parametrize
(
"param"
,
sign_calendar_data
,
ids
=
sign_calendar_case
)
def
test_favors_diaries
(
self
,
param
):
r
=
user_request
()
.
sign_calendar
()
assert
r
[
"error"
]
==
param
[
"assert"
]
assert
r
[
"data"
][
"user_id"
]
is
not
None
and
r
[
"data"
][
"user_id"
]
is
not
""
# 判断用户名是否为空
test_backend_case/user_case/test_sign_exchanged.py
0 → 100644
View file @
e4459b3c
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.user_request
import
user_request
class
TestSignExchanged
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SIGN_EXCHANGED
)
sign_exchanged_case
,
sign_exchanged_data
=
get_ids
(
data
,
"sign_exchanged"
)
@pytest.mark.parametrize
(
"param"
,
sign_exchanged_data
,
ids
=
sign_exchanged_case
)
def
test_favors_diaries
(
self
,
param
):
r
=
user_request
()
.
sign_exchanged
()
assert
r
[
"error"
]
==
param
[
"assert"
]
# 校验字段是否存在
# assert r["data"] is True
test_backend_data/user_data/base_sign_data.yaml
0 → 100644
View file @
e4459b3c
base_sign_data
:
#签到基础信息
-
case
:
"
签到基础信息"
assert
:
0
\ No newline at end of file
test_backend_data/user_data/sign_calendar.yaml
0 → 100644
View file @
e4459b3c
sign_calendar
:
#签到日历
-
case
:
"
签到日历"
assert
:
0
\ No newline at end of file
test_backend_data/user_data/sign_exchanged.yaml
0 → 100644
View file @
e4459b3c
sign_exchanged
:
#签到奖品兑换记录
-
case
:
"
签到奖品兑换记录"
assert
:
0
\ No newline at end of file
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