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
3d12f8fa
Commit
3d12f8fa
authored
May 12, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'common_dev' into zwn_dev
parents
021fb573
0e8407e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
0 deletions
+71
-0
gmai_request.py
all_backend_api/gmai_request.py
+20
-0
gmai_request.yaml
all_backend_api/gmai_request.yaml
+10
-0
path_setting.py
path_setting.py
+4
-0
__init__.py
test_backend_case/gmai_case/__init__.py
+0
-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
skin_newReport.yaml
test_backend_data/gmai_data/skin_newReport.yaml
+8
-0
No files found.
all_backend_api/gmai_request.py
0 → 100644
View file @
3d12f8fa
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"
])
if
__name__
==
'__main__'
:
print
(
gmai_request
()
.
skin_newReport
(
"7.43.0"
,
"https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"
))
\ No newline at end of file
all_backend_api/gmai_request.yaml
0 → 100644
View file @
3d12f8fa
skin_newReport
:
method
:
post
url
:
/gm_ai/skin/new_report
params
:
version
:
${version}
data
:
image_url
:
${image_url}
path_setting.py
View file @
3d12f8fa
...
...
@@ -50,6 +50,10 @@ 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"
)
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/gmai_case/__init__.py
0 → 100644
View file @
3d12f8fa
test_backend_case/gmai_case/test_skin_newreport.py
0 → 100644
View file @
3d12f8fa
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 @
3d12f8fa
test_backend_data/gmai_data/skin_newReport.yaml
0 → 100644
View file @
3d12f8fa
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
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