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
423e75d3
Commit
423e75d3
authored
Apr 21, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Plain Diff
AI
parents
112c2222
5c181acf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
100 additions
and
3 deletions
+100
-3
oneimage_request.py
all_backend_api/oneimage_request.py
+29
-0
oneimage_request.yaml
all_backend_api/oneimage_request.yaml
+18
-0
base_request.py
in_common/base_request.py
+3
-3
path_setting.py
path_setting.py
+25
-0
__init__.py
test_backend_case/oneimage_case/__init__.py
+0
-0
test_recomend_services.py
test_backend_case/oneimage_case/test_recomend_services.py
+3
-0
test_share_v4.py
test_backend_case/oneimage_case/test_share_v4.py
+6
-0
__init__.py
test_backend_data/oneimage_data/__init__.py
+0
-0
recomend_services.yaml
test_backend_data/oneimage_data/recomend_services.yaml
+8
-0
share_v4.yaml
test_backend_data/oneimage_data/share_v4.yaml
+8
-0
No files found.
all_backend_api/oneimage_request.py
0 → 100644
View file @
423e75d3
import
path_setting
from
in_common.base_request
import
BaseRequest
class
oneimage_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
ONEIMAGE_SHARE_V4_CONFIG
)
# 测颜值结果页
def
share_v4
(
self
,
version
,
face_id
):
self
.
params
[
"version"
]
=
version
self
.
params
[
"face_id"
]
=
face_id
return
self
.
api_send
(
self
.
data
[
"share_v4"
])
# 测颜值结果页,根据五官推荐美购接口
def
recomend_services
(
self
,
version
,
business_tags_names
):
self
.
params
[
"version"
]
=
version
self
.
params
[
"business_tags_names"
]
=
business_tags_names
return
self
.
api_send
(
self
.
data
[
"recomend_services"
])
if
__name__
==
'__main__'
:
print
(
oneimage_request
()
.
share_v4
(
"7.42.2"
,
"27320150"
))
business_tags_names
=
'[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
print
(
oneimage_request
()
.
recomend_services
(
"7.42.2"
,
business_tags_names
))
\ No newline at end of file
all_backend_api/oneimage_request.yaml
0 → 100644
View file @
423e75d3
#测肤结果页
share_v4
:
method
:
post
url
:
/api/one_image/share/v4
params
:
version
:
${version}
data
:
face_id
:
${face_id}
json
:
{}
#测肤结果根据五官推荐美购
recomend_services
:
method
:
get
url
:
/api/one_image/recomend/services
params
:
version
:
${version}
business_tags_names
:
${business_tags_names}
json
:
{}
in_common/base_request.py
View file @
423e75d3
...
...
@@ -64,9 +64,9 @@ class BaseRequest:
host
=
self
.
api_load
(
path_setting
.
HOSTYAML_CONFIG
)
url_host
=
""
if
host
[
"develop_host"
]
.
get
(
"doctor"
)
==
"http://doctor.paas-develop.env"
:
if
host
[
"develop_host"
]
.
get
(
"doctor"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'doctor'
]
elif
host
[
"develop_host"
]
.
get
(
"backend"
)
==
"http://backend.paas-develop.env"
:
elif
host
[
"develop_host"
]
.
get
(
"backend"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'backend'
]
raw
=
yaml
.
dump
(
req
)
# 将一个python对象生成为yaml文档
...
...
@@ -86,7 +86,7 @@ class BaseRequest:
params
=
req
.
get
(
'params'
),
# headers=user_headers,
data
=
req
.
get
(
'data'
),
json
=
req
.
get
(
'json'
)
json
=
req
.
get
(
'json'
)
,
verify
=
False
)
return
r
.
json
()
...
...
path_setting.py
View file @
423e75d3
...
...
@@ -12,6 +12,16 @@ DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diar
DIARY_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"diary_data.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"
)
SERVICE_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web2_data"
,
"service_list.yaml"
)
SERVICE_URL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_doctor_api"
,
"web2_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"
)
...
...
@@ -20,9 +30,24 @@ SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "
SERVICE_URL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_doctor_api"
,
"web2_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"
)
SERVICE_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web2_data"
,
"service_list.yaml"
)
SERVICE_URL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_doctor_api"
,
"web2_request.yaml"
)
# 首页灰度v9,精选tab
FEED_INDEXV9_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"feed_request.yaml"
)
FEED_INDEXV9_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/feed_data"
,
"index_v9.yaml"
)
# 测颜值结果页
ONEIMAGE_SHARE_V4_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"oneimage_request.yaml"
)
ONEIMAGE_SHARE_V4_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/oneimage_data"
,
"share_v4.yaml"
)
ONEIMAGE_RECOMEND_SERVICES_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/oneimage_data"
,
"recomend_services.yaml"
)
LOGIN_PASSWD
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/accounts_data"
,
"login_passwd.yaml"
)
LOGIN_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"accounts_request.yaml"
)
...
...
test_backend_case/oneimage_case/__init__.py
0 → 100644
View file @
423e75d3
test_backend_case/oneimage_case/test_recomend_services.py
View file @
423e75d3
...
...
@@ -10,7 +10,10 @@ class TestRecomendServices:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ONEIMAGE_RECOMEND_SERVICES_DATA
)
recomendservice_case
,
recomendservice_data
=
get_ids
(
data
,
"recomend_services"
)
<<<<<<<
HEAD
@pytest.mark.skip
(
"跳过测颜值根据五官推荐美购,目前数据是参数是线上的-------------------"
)
=======
>>>>>>>
zwn_test
@pytest.mark.parametrize
(
"param"
,
recomendservice_data
,
ids
=
recomendservice_case
)
def
test_recomend_services
(
self
,
param
):
r
=
oneimage_request
()
.
recomend_services
(
param
[
"version"
],
param
[
"business_tags_names"
])
...
...
test_backend_case/oneimage_case/test_share_v4.py
View file @
423e75d3
...
...
@@ -7,6 +7,7 @@ from all_backend_api.oneimage_request import oneimage_request
class
TestShareV4
:
<<<<<<<
HEAD
"""
测颜值结果页,分享结果
"""
...
...
@@ -14,6 +15,11 @@ class TestShareV4:
sharev4_case
,
sharev4_data
=
get_ids
(
data
,
"share_v4"
)
@pytest.mark.skip
(
"跳过,测颜值结果v4,目前数据是线上的-------------------"
)
=======
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ONEIMAGE_SHARE_V4_DATA
)
sharev4_case
,
sharev4_data
=
get_ids
(
data
,
"share_v4"
)
>>>>>>>
zwn_test
@pytest.mark.parametrize
(
"param"
,
sharev4_data
,
ids
=
sharev4_case
)
def
test_share_v4
(
self
,
param
):
r
=
oneimage_request
()
.
share_v4
(
param
[
"version"
],
param
[
"face_id"
])
...
...
test_backend_data/oneimage_data/__init__.py
0 → 100644
View file @
423e75d3
test_backend_data/oneimage_data/recomend_services.yaml
0 → 100644
View file @
423e75d3
recomend_services
:
#成功登录case
-
case
:
"
请求成功,有数据返回"
version
:
"
7.42.2"
business_tags_names
:
'
[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
assert
:
0
\ No newline at end of file
test_backend_data/oneimage_data/share_v4.yaml
0 → 100644
View file @
423e75d3
share_v4
:
#成功登录case
-
case
:
"
请求成功,有数据返回"
version
:
"
7.42.2"
face_id
:
"
27320150"
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