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
3ea11998
Commit
3ea11998
authored
May 19, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common_dev' into zwn_dev
parents
643d4b89
1c6a21d0
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
134 additions
and
15 deletions
+134
-15
diary_data_request.py
all_backend_api/diary_data_request.py
+2
-2
notification_request.py
all_backend_api/notification_request.py
+7
-2
notification_request.yaml
all_backend_api/notification_request.yaml
+14
-0
service_request.py
all_backend_api/service_request.py
+1
-1
user_request.py
all_backend_api/user_request.py
+16
-0
user_request.yaml
all_backend_api/user_request.yaml
+12
-0
host.yaml
host.yaml
+1
-1
base_request.py
in_common/base_request.py
+14
-5
path_setting.py
path_setting.py
+4
-1
test_readall.py
test_backend_case/notification_case/test_readall.py
+18
-0
test_home_v5.py
test_backend_case/service_case/test_home_v5.py
+2
-2
test_personal_center.py
test_backend_case/user_case/test_personal_center.py
+20
-0
readall.yaml
test_backend_data/notification_data/readall.yaml
+9
-0
home_v5.yaml
test_backend_data/service_data/home_v5.yaml
+1
-1
personal_center.yaml
test_backend_data/user_data/personal_center.yaml
+13
-0
No files found.
all_backend_api/diary_data_request.py
View file @
3ea11998
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
):
...
...
all_backend_api/notification_request.py
View file @
3ea11998
...
...
@@ -10,7 +10,12 @@ class notification_request(BaseRequest):
self
.
params
[
"uqid"
]
=
uqid
self
.
params
[
"trace_id"
]
=
trace_id
return
self
.
api_send
(
self
.
data
[
"unread"
])
def
readall
(
self
,
uqid
,
trace_id
,
ua
):
self
.
params
[
"uqid"
]
=
uqid
self
.
params
[
"trace_id"
]
=
trace_id
self
.
params
[
"ua"
]
=
ua
return
self
.
api_send
(
self
.
data
[
"readall"
])
if
__name__
==
'__main__'
:
print
(
notification_request
()
.
unread
(
"1B519701-A4F5-453E-9D99-140B5AF697A0"
,
"2021/04/22/1722/46cf97b999b0"
))
#print(notification_request().unread("1B519701-A4F5-453E-9D99-140B5AF697A0", "2021/04/22/1722/46cf97b999b0"))
print
(
notification_request
()
.
readall
(
"1B519701-A4F5-453E-9D99-140B5AF697A0"
,
"2021/05/19/1526/19fcd4c4be47"
,
"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
))
all_backend_api/notification_request.yaml
View file @
3ea11998
#未读消息数
unread
:
method
:
get
url
:
/api/notification/unread
...
...
@@ -9,3 +10,15 @@ unread:
json
:
{}
isLogin
:
1
#需要登录的接口
#标记为已读
readall
:
method
:
post
url
:
/api/notification/readall
params
:
uqid
:
${uqid}
trace_id
:
${trace_id}
ua
:
${ua}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录的接口
\ No newline at end of file
all_backend_api/service_request.py
View file @
3ea11998
...
...
@@ -5,7 +5,7 @@ from in_common.base_request import BaseRequest
class
service_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
HOME_V5_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
HOME_V5_CONFIG
)
#/all_backend_api/service_request.yaml
def
home_v5
(
self
):
...
...
all_backend_api/user_request.py
View file @
3ea11998
...
...
@@ -4,6 +4,16 @@ from in_common.base_request import BaseRequest
class
user_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
PERSONAL_CENTER_CONFIG
)
def
personal_center
(
self
):
print
(
"fgx"
)
return
self
.
api_send
(
self
.
data
[
"personal_center"
])
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
USER_ANSWER_CONFIG
)
...
...
@@ -14,5 +24,11 @@ class user_request(BaseRequest):
if
__name__
==
'__main__'
:
#个人中心
print
(
user_request
()
.
personal_center
())
print
(
"fgx"
)
#打印医生/医院主页问答列表接口返回
print
(
user_request
()
.
answer
(
"21476198"
))
all_backend_api/user_request.yaml
View file @
3ea11998
personal_center
:
method
:
GET
url
:
/api/user/personal_center
params
:
choose_id
:
0
community_id
:
0
version
:
7.42.0
data
:
{}
json
:
{}
isLogin
:
1
#医院主页-问答接口
answer
:
method
:
get
...
...
@@ -8,3 +19,4 @@ answer:
page
:
1
data
:
{}
json
:
{}
host.yaml
View file @
3ea11998
develop_host
:
backend
:
http://backend.paas-develop.env
#
doctor: http://doctor.paas-develop.env
doctor
:
http://doctor.paas-develop.env
in_common/base_request.py
View file @
3ea11998
...
...
@@ -63,11 +63,20 @@ class BaseRequest:
def
api_send
(
self
,
req
:
dict
):
host
=
self
.
api_load
(
path_setting
.
HOSTYAML_CONFIG
)
url_host
=
""
if
host
[
"develop_host"
]
.
get
(
"doctor"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'doctor'
]
elif
host
[
"develop_host"
]
.
get
(
"backend"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'backend'
]
# 获取调用该方法的路径
import
inspect
ins_file
=
inspect
.
stack
()[
1
]
.
filename
ins_dir
=
ins_file
.
split
(
'/'
)[
-
2
]
host_service
=
ins_dir
.
split
(
'_'
)[
1
]
# default: backend
if
host_service
not
in
host
[
'develop_host'
]:
host_service
=
'backend'
url_host
=
host
[
'develop_host'
][
host_service
]
# if host["develop_host"].get("doctor") is not None:
# url_host = host['develop_host']['doctor']
# elif host["develop_host"].get("backend") is not None:
# url_host = host['develop_host']['backend']
raw
=
yaml
.
dump
(
req
)
# 将一个python对象生成为yaml文档
for
key
,
value
in
self
.
params
.
items
():
...
...
path_setting.py
View file @
3ea11998
...
...
@@ -103,6 +103,8 @@ MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conv
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"
)
PERSONAL_CENTER_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"user_request.yaml"
)
PERSONAL_CENTER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/user_data"
,
"personal_center.yaml"
)
#搜索结果页-综合/百科
CONTENTV7_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
...
...
@@ -130,7 +132,8 @@ AUTO_MSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "aut
#消息页未读数
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"
)
#标记为已读
READALL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/notification_data"
,
"readall.yaml"
)
if
__name__
==
'__main__'
:
...
...
test_backend_case/notification_case/test_readall.py
0 → 100644
View file @
3ea11998
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
TestReadall
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
READALL
)
readall_case
,
readall_data
=
get_ids
(
data
,
"readall"
)
@pytest.mark.parametrize
(
"param"
,
readall_data
,
ids
=
readall_case
)
def
test_readall
(
self
,
param
):
r
=
notification_request
()
.
readall
(
param
[
"uqid"
],
param
[
"trace_id"
],
param
[
"ua"
])
print
(
r
)
assert
r
[
"error"
]
==
0
\ No newline at end of file
test_backend_case/service_case/test_home_v5.py
View file @
3ea11998
...
...
@@ -9,13 +9,13 @@ from all_backend_api.service_request import service_request
class
TestHomeV5
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
HOME_V5
)
homev5_case
,
homev5_data
=
get_ids
(
data
,
"home_v5"
)
print
(
data
)
@pytest.mark.parametrize
(
"param"
,
homev5_data
,
ids
=
homev5_case
)
def
test_home_v5
(
self
,
param
):
#print(param["home_v5"])
r
=
service_request
()
.
home_v5
()
print
(
r
)
print
(
"home_v6"
)
#if r["error"] == 0:
assert
r
[
"error"
]
==
param
[
"assert"
]
...
...
test_backend_case/user_case/test_personal_center.py
0 → 100644
View file @
3ea11998
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
TestPersonalCenter
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
PERSONAL_CENTER
)
personalcenter_case
,
personalcenter_data
=
get_ids
(
data
,
"personal_center"
)
@pytest.mark.parametrize
(
"param"
,
personalcenter_data
,
ids
=
personalcenter_case
)
def
test_personal_center
(
self
,
param
):
r
=
user_request
()
.
personal_center
()
print
(
'feng='
,
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
assert
r
[
"data"
][
"user"
][
"portrait"
]
!=
param
[
"portrait"
]
test_backend_data/notification_data/readall.yaml
0 → 100644
View file @
3ea11998
readall
:
#验证成功case
-
case
:
"
标记为已读成功"
uqid
:
"
1B519701-A4F5-453E-9D99-140B5AF697A0"
trace_id
:
"
2021/05/19/1526/19fcd4c4be47"
ua
:
"
Mozilla/5.0
(iPhone;
CPU
iPhone
OS
12_2
like
Mac
OS
X)
AppleWebKit/605.1.15
(KHTML,
like
Gecko)
Mobile/15E148"
assert
:
0
\ No newline at end of file
test_backend_data/service_data/home_v5.yaml
View file @
3ea11998
home_v5
:
#获取商城首页
-
case
:
"
获取商城首页--case首页"
case
:
"
获取商城首页
index
--case首页"
assert
:
0
...
...
test_backend_data/user_data/personal_center.yaml
0 → 100644
View file @
3ea11998
personal_center
:
#个人中心
-
case
:
"
获取个人中心--case首页"
assert
:
0
portrait
:
null
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