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
713a25f8
Commit
713a25f8
authored
Apr 21, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Plain Diff
提交新脚本
parents
e8ca6669
418f7a40
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
212 additions
and
0 deletions
+212
-0
.DS_Store
.DS_Store
+0
-0
conversation_request.py
all_backend_api/conversation_request.py
+25
-0
conversation_request.yaml
all_backend_api/conversation_request.yaml
+13
-0
im_request.py
all_backend_api/im_request.py
+25
-0
im_request.yaml
all_backend_api/im_request.yaml
+14
-0
my_conversation_request.py
all_backend_api/my_conversation_request.py
+18
-0
my_conversation_request.yaml
all_backend_api/my_conversation_request.yaml
+12
-0
path_setting.py
path_setting.py
+14
-0
__init__.py
test_backend_case/conversation_case/__init__.py
+0
-0
test_message_read.py
test_backend_case/conversation_case/test_message_read.py
+22
-0
__init__.py
test_backend_case/im_case/__init__.py
+0
-0
test_conversation_detail.py
test_backend_case/im_case/test_conversation_detail.py
+19
-0
test_my_conversation.py
...backend_case/my_conversation_case/test_my_conversation.py
+21
-0
__init__.py
test_backend_data/conversation_data/__init__.py
+0
-0
message_read.yaml
test_backend_data/conversation_data/message_read.yaml
+10
-0
__init__.py
test_backend_data/im_data/__init__.py
+0
-0
conversation_detail.yaml
test_backend_data/im_data/conversation_detail.yaml
+10
-0
my_conversation.yaml
test_backend_data/my_conversation_data/my_conversation.yaml
+9
-0
No files found.
.DS_Store
View file @
713a25f8
No preview for this file type
all_backend_api/conversation_request.py
0 → 100644
View file @
713a25f8
import
path_setting
from
in_common.base_request
import
BaseRequest
class
conversation_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
messageread
=
self
.
api_load
(
path_setting
.
MESSAGE_READ_CONFIG
)
#self.data = self.api_load(path_setting.MESSAGE_READ_CONFIG)
def
message_read
(
self
,
current_city_id
,
release
,
message_ids
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"release"
]
=
release
#self.params["uqid"] = uqid
self
.
params
[
"message_ids"
]
=
message_ids
return
self
.
api_send
(
self
.
messageread
[
"message_read"
])
if
__name__
==
'__main__'
:
print
(
conversation_request
()
.
message_read
(
"beijing"
,
1
,
'[10622,10626,10646,10651]'
))
#print(conversation_request.data(""))
all_backend_api/conversation_request.yaml
0 → 100644
View file @
713a25f8
message_read
:
method
:
post
url
:
/api/conversation/message/read
params
:
current_city_id
:
${current_city_id}
release
:
${release}
#uqid: ${uqid}
data
:
message_ids
:
${message_ids}
json
:
{}
isLogin
:
1
#需要登录的接口
\ No newline at end of file
all_backend_api/im_request.py
0 → 100644
View file @
713a25f8
import
path_setting
from
in_common.base_request
import
BaseRequest
class
im_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
CONVERSATION_DETAIL_CONFIG
)
def
conversation_detail
(
self
,
current_city_id
,
begin_msg_id
,
conversation_type
,
end_msg_id
,
referrer
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"begin_msg_id"
]
=
begin_msg_id
self
.
params
[
"conversation_type"
]
=
conversation_type
self
.
params
[
"end_msg_id"
]
=
end_msg_id
self
.
params
[
"referrer"
]
=
referrer
return
self
.
api_send
(
self
.
data
[
"conversation_detail"
])
if
__name__
==
'__main__'
:
print
(
im_request
()
.
conversation_detail
(
"beijing"
,
0
,
4
,
0
,
"message_home"
))
all_backend_api/im_request.yaml
0 → 100644
View file @
713a25f8
conversation_detail
:
method
:
get
url
:
/api/im/conversation/detail
params
:
current_city_id
:
${current_city_id}
begin_msg_id
:
${begin_msg_id}
conversation_type
:
${conversation_type}
end_msg_id
:
${begin_msg_id}
referrer
:
${referrer}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录的接口
\ No newline at end of file
all_backend_api/my_conversation_request.py
View file @
713a25f8
import
path_setting
from
in_common.base_request
import
BaseRequest
class
my_conversation_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
MY_CONVERSATION_CONFIG
)
def
my_conversation
(
self
,
current_city_id
,
start_num
,
count
,):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"start_num"
]
=
start_num
self
.
params
[
"count"
]
=
count
return
self
.
api_send
(
self
.
data
[
"my_conversation"
])
if
__name__
==
'__main__'
:
print
(
my_conversation_request
()
.
my_conversation
(
"beijing"
,
"0"
,
10
))
\ No newline at end of file
all_backend_api/my_conversation_request.yaml
View file @
713a25f8
my_conversation
:
method
:
get
url
:
/api/my_conversation/
params
:
current_city_id
:
${current_city_id}
start_num
:
${start_num}
count
:
10
data
:
{}
json
:
{}
isLogin
:
1
#需要登录的接口
\ No newline at end of file
path_setting.py
View file @
713a25f8
...
...
@@ -63,6 +63,7 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
HOME_V5_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"service_request.yaml"
)
HOME_V5
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/service_data"
,
"home_v5.yaml"
)
#直播
LIVEYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"live_request.yaml"
)
#直播-获取弹幕
...
...
@@ -70,5 +71,18 @@ DANMU_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "d
#消息列表
MY_CONVERSATION_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"my_conversation_request.yaml"
)
MY_CONVERSATION
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/my_conversation_data"
,
"my_conversation.yaml"
)
#消息
MESSAGE_READ_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"conversation_request.yaml"
)
MESSAGE_READ
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/conversation_data"
,
"message_read.yaml"
)
#咨询顾问
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"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_backend_case/conversation_case/__init__.py
0 → 100644
View file @
713a25f8
test_backend_case/conversation_case/test_message_read.py
0 → 100644
View file @
713a25f8
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.conversation_request
import
conversation_request
class
TestMessageRead
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
MESSAGE_READ
)
#conversation_case, conversation_data = get_ids(data, "message_read")
messageread_case
,
messageread_data
=
get_ids
(
data
,
"message_read"
)
@pytest.mark.parametrize
(
"param"
,
messageread_data
,
ids
=
messageread_case
)
def
test_message_read
(
self
,
param
):
r
=
conversation_request
()
.
message_read
(
param
[
"current_city_id"
],
param
[
"release"
],
param
[
"message_ids"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"success"
]
==
param
[
"assert"
]
#if r["error"] == 0:
# success = r.get("data").get("success", "")
test_backend_case/im_case/__init__.py
0 → 100644
View file @
713a25f8
test_backend_case/im_case/test_conversation_detail.py
0 → 100644
View file @
713a25f8
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.im_request
import
im_request
class
TestConversationDetail
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATION_DETAIL
)
conversationdetail_case
,
conversationdetail_data
=
get_ids
(
data
,
"conversation_detail"
)
@pytest.mark.parametrize
(
"param"
,
conversationdetail_data
,
ids
=
conversationdetail_case
)
def
test_conversation_detail
(
self
,
param
):
r
=
im_request
()
.
conversation_detail
(
param
[
"current_city_id"
],
param
[
"begin_msg_id"
],
param
[
"conversation_type"
],
param
[
"end_msg_id"
],
param
[
"referrer"
])
if
r
[
"error"
]
==
0
:
msg_list
=
r
.
get
(
"data"
)
.
get
(
"msg_list"
,[])
assert
len
(
msg_list
)
>
param
[
"assert"
]
test_backend_case/my_conversation_case/test_my_conversation.py
0 → 100644
View file @
713a25f8
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.my_conversation_request
import
my_conversation_request
class
TestMyConversation
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
MY_CONVERSATION
)
my_conversation_case
,
my_conversation_data
=
get_ids
(
data
,
"my_conversation"
)
@pytest.mark.parametrize
(
"param"
,
my_conversation_data
,
ids
=
my_conversation_case
)
def
test_my_conversation
(
self
,
param
):
'''私信列表'''
r
=
my_conversation_request
()
.
my_conversation
(
param
[
"current_city_id"
],
param
[
"start_num"
],
param
[
"count"
])
if
r
[
"error"
]
==
0
:
conversation_list
=
r
.
get
(
"data"
)
.
get
(
"conversation_list"
,
[])
assert
len
(
conversation_list
)
<=
param
[
"assert"
]
test_backend_data/conversation_data/__init__.py
0 → 100644
View file @
713a25f8
test_backend_data/conversation_data/message_read.yaml
0 → 100644
View file @
713a25f8
message_read
:
#验证成功case
-
case
:
"
请求成功case"
current_city_id
:
"
beijing"
release
:
1
#uqid: "1B519701-A4F5-453E-9D99-140B5AF697A0"
message_ids
:
[
10622
,
10626
,
10646
,
10651
]
assert
:
"
true"
\ No newline at end of file
test_backend_data/im_data/__init__.py
0 → 100644
View file @
713a25f8
test_backend_data/im_data/conversation_detail.yaml
0 → 100644
View file @
713a25f8
conversation_detail
:
#验证成功case
-
case
:
"
请求成功,有数据返回"
current_city_id
:
"
beijing"
begin_msg_id
:
0
conversation_type
:
4
end_msg_id
:
0
referrer
:
message_home
assert
:
0
test_backend_data/my_conversation_data/my_conversation.yaml
0 → 100644
View file @
713a25f8
my_conversation
:
#验证成功case
-
case
:
"
请求成功,有数据返回的第一页数据"
current_city_id
:
"
beijing"
start_num
:
0
count
:
10
assert
:
10
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