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
32d3ae4a
You need to sign in or sign up before continuing.
Commit
32d3ae4a
authored
May 17, 2021
by
张慧
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common_dev' into zhanghui_dev
parents
6ead9b8e
144fb9fc
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
126 additions
and
5 deletions
+126
-5
.DS_Store
.DS_Store
+0
-0
gmai_request.py
all_backend_api/gmai_request.py
+28
-0
gmai_request.yaml
all_backend_api/gmai_request.yaml
+17
-0
base_request.py
in_common/base_request.py
+2
-2
path_setting.py
path_setting.py
+6
-0
.DS_Store
test_backend_case/.DS_Store
+0
-0
__init__.py
test_backend_case/gmai_case/__init__.py
+0
-0
test_eyelids_plastic.py
test_backend_case/gmai_case/test_eyelids_plastic.py
+18
-0
test_skin_newreport.py
test_backend_case/gmai_case/test_skin_newreport.py
+29
-0
__init__.py
test_backend_data/gmai_data/__init__.py
+0
-0
eyelids_plastic.yaml
test_backend_data/gmai_data/eyelids_plastic.yaml
+15
-0
skin_newReport.yaml
test_backend_data/gmai_data/skin_newReport.yaml
+8
-0
recomend_services.yaml
test_backend_data/oneimage_data/recomend_services.yaml
+3
-3
No files found.
.DS_Store
View file @
32d3ae4a
No preview for this file type
all_backend_api/gmai_request.py
0 → 100644
View file @
32d3ae4a
import
path_setting
from
in_common.base_request
import
BaseRequest
class
gmai_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
GMAI_SKIN_NEWREPORT_CONFIG
)
# 测颜值结果页
def
skin_newReport
(
self
,
version
,
image_url
):
self
.
params
[
"version"
]
=
version
self
.
params
[
"image_url"
]
=
image_url
return
self
.
api_send
(
self
.
data
[
"skin_newReport"
])
# 模拟双眼皮
def
eyelids_plastic
(
self
,
version
,
image_url
,
style_id
):
self
.
params
[
"version"
]
=
version
self
.
params
[
"image_url"
]
=
image_url
self
.
params
[
"style_id"
]
=
style_id
return
self
.
api_send
(
self
.
data
[
"eyelids_plastic"
])
# if __name__ == '__main__':
# # print(gmai_request().skin_newReport("7.43.0","https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"))
# # print(gmai_request().eyelids_plastic("7.43.0", "2021/05/12/1457/cdbe8652117d","3"))
all_backend_api/gmai_request.yaml
0 → 100644
View file @
32d3ae4a
skin_newReport
:
method
:
post
url
:
/gm_ai/skin/new_report
params
:
version
:
${version}
data
:
image_url
:
${image_url}
eyelids_plastic
:
method
:
post
url
:
/gm_ai/eyelids/plastic
params
:
version
:
${version}
data
:
image_url
:
${image_url}
style_id
:
${style_id}
in_common/base_request.py
View file @
32d3ae4a
...
...
@@ -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文档
...
...
path_setting.py
View file @
32d3ae4a
...
...
@@ -50,6 +50,12 @@ ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/
# 测颜值根据五官推荐美购
ONEIMAGE_RECOMEND_SERVICES_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/oneimage_data"
,
"recomend_services.yaml"
)
# 测肤结果页
GMAI_SKIN_NEWREPORT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"gmai_request.yaml"
)
GMAI_SKIN_NEWREPORT_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"skin_newReport.yaml"
)
# 模拟双眼皮
GMAI_EYELIDS_PLASTIC_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/gmai_data"
,
"eyelids_plastic.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/.DS_Store
View file @
32d3ae4a
No preview for this file type
test_backend_case/gmai_case/__init__.py
0 → 100644
View file @
32d3ae4a
test_backend_case/gmai_case/test_eyelids_plastic.py
0 → 100644
View file @
32d3ae4a
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.gmai_request
import
gmai_request
# 模拟双眼皮效果
class
TestEyelidsPlastic
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
GMAI_EYELIDS_PLASTIC_DATA
)
eyelidsplastic_case
,
eyelidsplastic_data
=
get_ids
(
data
,
"eyelids_plastic"
)
@pytest.mark.parametrize
(
"param"
,
eyelidsplastic_data
,
ids
=
eyelidsplastic_case
)
def
test_skinnewReport
(
self
,
param
):
r
=
gmai_request
()
.
eyelids_plastic
(
param
[
"version"
],
param
[
"image_url"
],
param
[
"style_id"
])
assert
r
[
"error"
]
==
0
print
(
"模拟双眼皮效果图片: "
,
r
[
"data"
][
"plastic_image_url"
])
\ No newline at end of file
test_backend_case/gmai_case/test_skin_newreport.py
0 → 100644
View file @
32d3ae4a
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.gmai_request
import
gmai_request
# 测肤结果页
class
TestSkinNewReport
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
GMAI_SKIN_NEWREPORT_DATA
)
skinnewReport_case
,
skinnewReport_data
=
get_ids
(
data
,
"skin_newReport"
)
@pytest.mark.parametrize
(
"param"
,
skinnewReport_data
,
ids
=
skinnewReport_case
)
def
test_skinnewReport
(
self
,
param
):
r
=
gmai_request
()
.
skin_newReport
(
param
[
"version"
],
param
[
"image_url"
])
if
r
[
"error"
]
==
0
:
data
=
r
.
get
(
"data"
)
# 大家都在买
packages
=
data
.
get
(
"packages"
)
assert
len
(
packages
)
==
6
# 皮肤检测结果
disadvantage_tabs
=
data
.
get
(
"disadvantage_tabs"
)
result_word
=
disadvantage_tabs
[
0
]
.
get
(
"result_word"
)
assert
result_word
==
"色素型黑眼圈"
test_backend_data/gmai_data/__init__.py
0 → 100644
View file @
32d3ae4a
test_backend_data/gmai_data/eyelids_plastic.yaml
0 → 100644
View file @
32d3ae4a
eyelids_plastic
:
#模拟双眼皮效果
-
case
:
"
平行双眼皮效果"
version
:
"
7.43.0"
image_url
:
"
2021/05/12/1457/cdbe8652117d"
style_id
:
"
1"
-
case
:
"
开扇双眼皮效果"
version
:
"
7.43.0"
image_url
:
"
2021/05/12/1457/cdbe8652117d"
style_id
:
"
3"
\ No newline at end of file
test_backend_data/gmai_data/skin_newReport.yaml
0 → 100644
View file @
32d3ae4a
skin_newReport
:
#测颜值根据五官推荐美购
-
case
:
"
请求成功"
version
:
"
7.43.0"
image_url
:
"
https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"
assert
:
1
\ No newline at end of file
test_backend_data/oneimage_data/recomend_services.yaml
View file @
32d3ae4a
...
...
@@ -3,5 +3,5 @@ recomend_services:
-
case
:
"
请求成功,返回个数正确"
version
:
"
7.42.2"
business_tags_names
:
'
[["鼻翼缩小","玻尿酸隆鼻","耳软骨隆鼻","鼻中隔软骨隆鼻"]]'
assert
:
1
\ No newline at end of file
business_tags_names
:
'
[["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"]]'
assert
:
2
\ 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