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
5c181acf
Commit
5c181acf
authored
Apr 20, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI根据五官推荐美购
parent
95ba9a05
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
8 deletions
+53
-8
oneimage_request.py
all_backend_api/oneimage_request.py
+12
-2
oneimage_request.yaml
all_backend_api/oneimage_request.yaml
+9
-1
host.yaml
host.yaml
+2
-2
base_request.py
in_common/base_request.py
+3
-3
path_setting.py
path_setting.py
+1
-0
test_recomend_services.py
test_backend_case/oneimage_case/test_recomend_services.py
+18
-0
recomend_services.yaml
test_backend_data/oneimage_data/recomend_services.yaml
+8
-0
No files found.
all_backend_api/oneimage_request.py
View file @
5c181acf
...
...
@@ -13,6 +13,16 @@ class oneimage_request(BaseRequest):
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"
))
\ No newline at end of file
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
View file @
5c181acf
#测肤结果页
share_v4
:
method
:
post
url
:
/api/one_image/share/v4
...
...
@@ -7,4 +8,11 @@ share_v4:
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
:
{}
host.yaml
View file @
5c181acf
develop_host
:
# backend: http://backend.paas-develop.env
doctor
:
http://doctor.paas-develop.env
backend
:
https://backend.igengmei.com
#
doctor: http://doctor.paas-develop.env
in_common/base_request.py
View file @
5c181acf
...
...
@@ -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 @
5c181acf
...
...
@@ -46,6 +46,7 @@ FEED_INDEXV9_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_
# 测颜值结果页
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/test_recomend_services.py
0 → 100644
View file @
5c181acf
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.oneimage_request
import
oneimage_request
# 测颜值根据五官推荐美购
class
TestRecomendServices
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ONEIMAGE_RECOMEND_SERVICES_DATA
)
recomendservice_case
,
recomendservice_data
=
get_ids
(
data
,
"recomend_services"
)
@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"
])
assert
r
[
"error"
]
==
param
[
"assert"
]
test_backend_data/oneimage_data/recomend_services.yaml
0 → 100644
View file @
5c181acf
recomend_services
:
#成功登录case
-
case
:
"
请求成功,有数据返回"
version
:
"
7.42.2"
business_tags_names
:
'
[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
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