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
f160b71e
Commit
f160b71e
authored
Jun 07, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新提交上周代码
parent
9f5a8672
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
228 additions
and
0 deletions
+228
-0
web_request.py
all_doctor_api/web_request.py
+23
-0
web_request.yaml
all_doctor_api/web_request.yaml
+45
-0
path_setting.py
path_setting.py
+12
-0
test_conversation.py
test_doctor_case/web_case/test_conversation.py
+22
-0
test_conversation_coupon.py
test_doctor_case/web_case/test_conversation_coupon.py
+20
-0
test_conversation_diary.py
test_doctor_case/web_case/test_conversation_diary.py
+22
-0
test_conversation_unread_list.py
test_doctor_case/web_case/test_conversation_unread_list.py
+22
-0
test_service.py
test_doctor_case/web_case/test_service.py
+22
-0
conversation.yaml
test_doctor_data/web_data/conversation.yaml
+8
-0
conversation_coupon.yaml
test_doctor_data/web_data/conversation_coupon.yaml
+12
-0
conversation_diary.yaml
test_doctor_data/web_data/conversation_diary.yaml
+6
-0
conversation_unread_list.yaml
test_doctor_data/web_data/conversation_unread_list.yaml
+7
-0
service.yaml
test_doctor_data/web_data/service.yaml
+7
-0
No files found.
all_doctor_api/web_request.py
View file @
f160b71e
...
@@ -20,8 +20,25 @@ class web_request(BaseRequest):
...
@@ -20,8 +20,25 @@ class web_request(BaseRequest):
self
.
params
[
"csrfmiddlewaretoken"
]
=
csrfmiddlewaretoken
self
.
params
[
"csrfmiddlewaretoken"
]
=
csrfmiddlewaretoken
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"service_offline"
])
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"service_offline"
])
def
conversation
(
self
,
is_star
,
page
):
self
.
params
[
"is_star"
]
=
is_star
self
.
params
[
"page"
]
=
page
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation"
])
def
conversation_unread_list
(
self
,
page
):
self
.
params
[
"page"
]
=
page
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation_unread_list"
])
def
service
(
self
):
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"service"
])
def
conversation_diary
(
self
,
doctor_user_id
):
self
.
params
[
"doctor_user_id"
]
=
doctor_user_id
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation_diary"
])
def
conversation_coupon
(
self
,
doctor_user_id
):
self
.
params
[
"doctor_user_id"
]
=
doctor_user_id
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation_coupon"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
@@ -29,3 +46,9 @@ if __name__ == '__main__':
...
@@ -29,3 +46,9 @@ if __name__ == '__main__':
print
(
web_request
()
.
article_videotoken
())
print
(
web_request
()
.
article_videotoken
())
print
(
web_request
()
.
doctor_submechanisms
())
print
(
web_request
()
.
doctor_submechanisms
())
print
(
web_request
()
.
service_offline
(
"209992"
,
"PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
))
print
(
web_request
()
.
service_offline
(
"209992"
,
"PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
))
print
(
web_request
()
.
conversation
(
0
,
1
))
print
(
web_request
()
.
conversation_unread_list
(
1
))
print
(
web_request
()
.
service
())
print
(
"发送"
)
print
(
web_request
()
.
conversation_diary
(
602329
))
print
(
web_request
()
.
conversation_coupon
(
602329
))
all_doctor_api/web_request.yaml
View file @
f160b71e
...
@@ -36,3 +36,48 @@ service_offline:
...
@@ -36,3 +36,48 @@ service_offline:
csrfmiddlewaretoken
:
${csrfmiddlewaretoken}
csrfmiddlewaretoken
:
${csrfmiddlewaretoken}
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
conversation
:
method
:
get
url
:
/api/web/conversation
params
:
is_star
:
${is_star}
page
:
${page}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_unread_list
:
method
:
get
url
:
/api/web/conversation/unread_list
params
:
page
:
${page}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
service
:
method
:
get
url
:
/api/web/service
params
:
{}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_diary
:
method
:
get
url
:
/api/web/conversation/diary
params
:
doctor_user_id
:
${doctor_user_id}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_coupon
:
method
:
get
url
:
/api/web/conversation/coupon
params
:
doctor_user_id
:
${doctor_user_id}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
path_setting.py
View file @
f160b71e
...
@@ -242,6 +242,18 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
...
@@ -242,6 +242,18 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"answer_request.yaml"
)
DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"answer_request.yaml"
)
DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/answer_data"
,
"detail.yaml"
)
DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/answer_data"
,
"detail.yaml"
)
#医生后台-全部私信列表
CONVERSATION
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation.yaml"
)
#医生后台-未读私信列表
CONVERSATIONUNREADLIST
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_unread_list.yaml"
)
#医生后台-发送商品按钮
SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"service.yaml"
)
#医生后台-发送案例
CONVERSATIONDIARY
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_diary.yaml"
)
#医生后台-发送优惠券
CONVERSATIONCOUPON
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_coupon.yaml"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_doctor_case/web_case/test_conversation.py
0 → 100644
View file @
f160b71e
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestConversation
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATION
)
conversation_case
,
conversation_data
=
get_ids
(
data
,
"conversation"
)
@pytest.mark.parametrize
(
"param"
,
conversation_data
,
ids
=
conversation_case
)
def
test_conversation
(
self
,
param
):
'''全部私信列表'''
r
=
web_request
()
.
conversation
(
param
[
"is_star"
],
param
[
"page"
])
if
r
[
"error"
]
==
0
:
conversation
=
r
.
get
(
"data"
)
.
get
(
"conversation"
,
[])
assert
len
(
conversation
)
<=
param
[
"assert"
]
assert
r
[
"data"
][
"size"
]
<=
param
[
"assert_size"
]
test_doctor_case/web_case/test_conversation_coupon.py
0 → 100644
View file @
f160b71e
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATIONCOUPON
)
conversationcoupon_case
,
conversationcoupon_data
=
get_ids
(
data
,
"conversation_coupon"
)
@pytest.mark.parametrize
(
"param"
,
conversationcoupon_data
,
ids
=
conversationcoupon_case
)
def
test_conversation_coupon
(
self
,
param
):
'''发送美券按钮'''
r
=
web_request
()
.
conversation_coupon
(
param
[
"doctor_user_id"
])
if
r
[
"error"
]
==
0
:
data1
=
r
.
get
(
"data"
,
[])
assert
len
(
data1
)
>=
param
[
"assert"
]
test_doctor_case/web_case/test_conversation_diary.py
0 → 100644
View file @
f160b71e
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestConversationDiary
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATIONDIARY
)
conversationdiary_case
,
conversationdiary_data
=
get_ids
(
data
,
"conversation_diary"
)
@pytest.mark.parametrize
(
"param"
,
conversationdiary_data
,
ids
=
conversationdiary_case
)
def
test_conversation_diary
(
self
,
param
):
'''点击发送案例按钮'''
r
=
web_request
()
.
conversation_diary
(
param
[
"doctor_user_id"
])
print
(
r
)
if
r
[
"error"
]
==
0
:
data
=
r
.
get
(
"data"
,
[])
assert
len
(
data
)
>=
param
[
"assert"
]
test_doctor_case/web_case/test_conversation_unread_list.py
0 → 100644
View file @
f160b71e
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestConversationUnreadList
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATIONUNREADLIST
)
unreadlist_case
,
unreadlist_data
=
get_ids
(
data
,
"conversation_unread_list"
)
@pytest.mark.parametrize
(
"param"
,
unreadlist_data
,
ids
=
unreadlist_case
)
def
test_conversation_unread_list
(
self
,
param
):
'''未读私信列表'''
r
=
web_request
()
.
conversation_unread_list
(
param
[
"page"
])
if
r
[
"error"
]
==
0
:
conversation
=
r
.
get
(
"data"
)
.
get
(
"conversation"
,
[])
assert
len
(
conversation
)
<=
param
[
"assert"
]
assert
r
[
"data"
][
"size"
]
<=
param
[
"assert_size"
]
test_doctor_case/web_case/test_service.py
0 → 100644
View file @
f160b71e
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SERVICE
)
service_case
,
service_data
=
get_ids
(
data
,
"service"
)
@pytest.mark.parametrize
(
"param"
,
service_data
,
ids
=
service_case
)
def
test_service
(
self
,
param
):
'''未读私信列表'''
r
=
web_request
()
.
service
()
if
r
[
"error"
]
==
0
:
data
=
r
.
get
(
"data"
)
.
get
(
"data"
,
[])
assert
len
(
data
)
<=
param
[
"assert"
]
assert
r
[
"data"
][
"size"
]
<=
param
[
"assert_size"
]
test_doctor_data/web_data/conversation.yaml
0 → 100644
View file @
f160b71e
conversation
:
#全部私信case
-
case
:
"
请求成功,有数据返回的第一页数据"
is_star
:
0
page
:
1
assert_size
:
10
assert
:
10
test_doctor_data/web_data/conversation_coupon.yaml
0 → 100644
View file @
f160b71e
conversation_coupon
:
#私信点击发送优惠券case
-
case
:
"
点击私信发送优惠券按钮"
doctor_user_id
:
"
602329"
assert
:
0
-
case
:
"
点击私信发送优惠券按钮接口报错"
doctor_user_id
:
"
602329"
assert
:
0
assert_message
:
'
缺少参数:
doctor_user_id'
assert_data
:
None
test_doctor_data/web_data/conversation_diary.yaml
0 → 100644
View file @
f160b71e
conversation_diary
:
#私信点击发送案例case
-
case
:
"
点击私信发送案例按钮"
doctor_user_id
:
602329
assert
:
0
test_doctor_data/web_data/conversation_unread_list.yaml
0 → 100644
View file @
f160b71e
conversation_unread_list
:
#未读私信case
-
case
:
"
请求成功,有未读消息"
page
:
1
assert_size
:
10
assert
:
10
test_doctor_data/web_data/service.yaml
0 → 100644
View file @
f160b71e
service
:
#私信点击发送商品case
-
case
:
"
点击私信发送商品按钮"
#page: 1
assert_size
:
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