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
9dd8506d
Commit
9dd8506d
authored
Apr 22, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未读消息数
parent
c9eb2e34
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
0 deletions
+71
-0
notification_request.py
all_backend_api/notification_request.py
+16
-0
notification_request.yaml
all_backend_api/notification_request.yaml
+11
-0
path_setting.py
path_setting.py
+4
-0
__init__.py
test_backend_case/notification_case/__init__.py
+0
-0
test_unread.py
test_backend_case/notification_case/test_unread.py
+32
-0
__init__.py
test_backend_data/notification_data/__init__.py
+0
-0
unread.yaml
test_backend_data/notification_data/unread.yaml
+8
-0
No files found.
all_backend_api/notification_request.py
0 → 100644
View file @
9dd8506d
import
path_setting
from
in_common.base_request
import
BaseRequest
class
notification_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
UNREAD_CONFIG
)
def
unread
(
self
,
uqid
,
trace_id
,):
self
.
params
[
"uqid"
]
=
uqid
self
.
params
[
"trace_id"
]
=
trace_id
return
self
.
api_send
(
self
.
data
[
"unread"
])
if
__name__
==
'__main__'
:
print
(
notification_request
()
.
unread
(
"1B519701-A4F5-453E-9D99-140B5AF697A0"
,
"2021/04/22/1722/46cf97b999b0"
))
all_backend_api/notification_request.yaml
0 → 100644
View file @
9dd8506d
unread
:
method
:
get
url
:
/api/notification/unread
params
:
uqid
:
${uqid}
trace_id
:
${trace_id}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录的接口
path_setting.py
View file @
9dd8506d
...
...
@@ -79,6 +79,10 @@ MESSAGE_READ = os.path.join(BASE_DIR, "backend_auto/test_backend_data/conversati
CONVERSATION_DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"im_request.yaml"
)
CONVERSATION_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/im_data"
,
"conversation_detail.yaml"
)
#消息页未读数
UNREAD_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"notification_request.yaml"
)
UNREAD
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/notification_data"
,
"unread.yaml"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_backend_case/notification_case/__init__.py
0 → 100644
View file @
9dd8506d
test_backend_case/notification_case/test_unread.py
0 → 100644
View file @
9dd8506d
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.notification_request
import
notification_request
class
TestUnread
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
UNREAD
)
unread_case
,
unread_data
=
get_ids
(
data
,
"unread"
)
@pytest.mark.parametrize
(
"param"
,
unread_data
,
ids
=
unread_case
)
def
test_unread
(
self
,
param
):
r
=
notification_request
()
.
unread
(
param
[
"uqid"
],
param
[
"trace_id"
])
#print("返回结果是:%s" % r)
total_count
=
r
[
"data"
][
"unread_count"
][
"total_count"
]
print
(
"总数量是:
%
s"
%
total_count
)
total_unread
=
r
.
get
(
"data"
)
.
get
(
"unread_count"
)
.
get
(
"follow_count"
)
.
get
(
"total_unread"
)
#关注总未读数
#print("总数量1是:%s" % total_unread)
message_count
=
r
[
"data"
][
"unread_count"
][
"message_count"
]
#私信列表总未读数
#print("私信列表总未读数是:%s" % message_count)
vote_favor
=
r
[
"data"
][
"unread_count"
][
"vote_favor_count"
][
"vote_favor"
]
#赞/收藏总未读数
#print("赞/收藏总未读数是:%s" % vote_favor)
reply_count
=
r
[
"data"
][
"unread_count"
][
"reply_count"
]
#回复总未读数
#print("回复总未读数是:%s" % reply_count)
count
=
total_unread
+
message_count
+
vote_favor
+
reply_count
#print("相加总数是是:%s" % count)
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"unread_count"
][
"total_count"
]
>=
param
[
"assert"
]
assert
r
[
"data"
][
"unread_count"
][
"total_count"
]
==
count
test_backend_data/notification_data/__init__.py
0 → 100644
View file @
9dd8506d
test_backend_data/notification_data/unread.yaml
0 → 100644
View file @
9dd8506d
unread
:
#验证成功case
-
case
:
"
请求成功,消息页各icon未读消息数等于总数"
uqid
:
"
1B519701-A4F5-453E-9D99-140B5AF697A0"
trace_id
:
"
2021/04/22/1722/46cf97b999b0"
#total_count:
assert
:
0
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