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
b47b8e4a
Commit
b47b8e4a
authored
Jul 16, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI
parent
22ddcd53
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
16 deletions
+99
-16
test_plastic_analysis_v3.py
test_backend_case/gmai_case/test_plastic_analysis_v3.py
+30
-3
test_simulate_analyze.py
test_backend_case/gmai_case/test_simulate_analyze.py
+6
-2
test_skin_newreport.py
test_backend_case/gmai_case/test_skin_newreport.py
+41
-7
test_share_v4.py
test_backend_case/oneimage_case/test_share_v4.py
+16
-2
share_v4.yaml
test_backend_data/oneimage_data/share_v4.yaml
+6
-2
No files found.
test_backend_case/gmai_case/test_plastic_analysis_v3.py
View file @
b47b8e4a
...
...
@@ -12,5 +12,33 @@ class TestPlasticnAnalysisV3:
@pytest.mark.parametrize
(
"param"
,
plasticanalysisv3_data
,
ids
=
plasticanalysisv3_case
)
def
test_plastic_analysis_v3
(
self
,
param
):
r
=
gmai_request
()
.
plastic_analysis_v3
(
param
[
"device_id"
],
param
[
"image_url"
],
param
[
"landmark"
]
,
param
[
"cheek_style_classify_id"
])
assert
r
[
"error"
]
==
0
\ No newline at end of file
r
=
gmai_request
()
.
plastic_analysis_v3
(
param
[
"device_id"
],
param
[
"image_url"
],
param
[
"landmark"
],
param
[
"cheek_style_classify_id"
])
assert
r
[
"error"
]
==
0
# 风格脸
face_analytics_info
=
r
[
"data"
][
"face_analytics_info"
]
assert
len
(
face_analytics_info
)
>
0
for
item
in
face_analytics_info
:
name
=
item
[
"name"
]
# 脸型科普
kepu_text
=
item
[
"analytics_info"
][
"unscramble"
][
0
][
"content_items"
][
0
][
"text"
]
# print(name,kepu_text)
assert
name
not
in
(
None
,
""
)
assert
kepu_text
not
in
(
None
,
""
)
# 模拟整形方向
content_items
=
item
[
"analytics_info"
][
"unscramble"
][
1
][
"content_items"
]
for
con
in
content_items
:
text
=
con
[
"text"
]
# print(text)
assert
text
not
in
(
None
,
""
)
# 模拟整形方案
recommends
=
item
[
"analytics_info"
][
"project"
][
"recommends"
]
assert
len
(
recommends
)
==
8
for
ser
in
recommends
:
text
=
ser
[
"text"
]
tag_name
=
ser
[
"tag_name"
]
gengmei_url
=
ser
[
"gengmei_url"
]
assert
text
not
in
(
None
,
""
)
assert
tag_name
not
in
(
None
,
""
)
assert
gengmei_url
==
"gengmei://search_result?q={}&searchTabType=8"
.
format
(
tag_name
)
test_backend_case/gmai_case/test_simulate_analyze.py
View file @
b47b8e4a
...
...
@@ -14,4 +14,8 @@ class TestSimulateAnalyze:
def
test_plastic_analysis_v3
(
self
,
param
):
r
=
gmai_request
()
.
simulate_analyze
(
param
[
"device_id"
],
param
[
"image_url"
],
param
[
"style_id"
]
,
param
[
"type_id"
])
assert
r
[
"error"
]
==
0
print
(
"效果图: "
,
r
[
"data"
][
"plastic_image_url"
])
\ No newline at end of file
gm_url
=
r
[
"data"
][
"plastic_image_url"
]
print
(
"效果图: "
,
gm_url
)
before_charm_val
=
r
[
"data"
][
"before_charm_val"
]
after_charm_val
=
r
[
"data"
][
"after_charm_val"
]
assert
before_charm_val
<
after_charm_val
\ No newline at end of file
test_backend_case/gmai_case/test_skin_newreport.py
View file @
b47b8e4a
...
...
@@ -10,7 +10,7 @@ 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
)
@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
:
...
...
@@ -19,11 +19,45 @@ class TestSkinNewReport:
# 大家都在买
packages
=
data
.
get
(
"packages"
)
assert
len
(
packages
)
==
6
# 皮肤检测结果
for
item
in
packages
:
package_id
=
item
[
"package_id"
]
package_name
=
item
[
"package_name"
]
tag_name
=
item
[
"tag_name"
]
gengmei_url
=
item
[
"gengmei_url"
]
print
(
package_id
,
package_name
,
tag_name
,
gengmei_url
)
assert
package_id
not
in
(
None
,
""
)
assert
package_name
not
in
(
None
,
""
)
assert
tag_name
not
in
(
None
,
""
)
assert
gengmei_url
==
"gengmei://service?service_id={}&has_task=0&sign_task_seconds=10&sign_points=20"
.
format
(
package_id
)
# 皮肤检测结果,重点关注部分
disadvantage_tabs
=
data
.
get
(
"disadvantage_tabs"
)
result_word
=
disadvantage_tabs
[
0
]
.
get
(
"result_word"
)
assert
result_word
==
"色素型黑眼圈"
analysis
=
disadvantage_tabs
[
0
][
"tab_data"
][
"analysis"
]
seriousness
=
disadvantage_tabs
[
0
][
"tab_data"
][
"seriousness"
]
print
(
result_word
,
analysis
,
seriousness
)
assert
result_word
not
in
(
None
,
""
)
assert
analysis
not
in
(
None
,
""
)
assert
seriousness
not
in
(
None
,
""
)
# 皮肤检测结果,其他部分
advantage_tabs
=
data
.
get
(
"advantage_tabs"
)
for
item
in
advantage_tabs
:
result_word
=
item
.
get
(
"result_word"
)
analysis
=
item
[
"tab_data"
][
"analysis"
]
seriousness
=
item
[
"tab_data"
][
"seriousness"
]
print
(
result_word
,
analysis
,
seriousness
)
# assert result_word not in (None, "") 测试环境有部分数据没有配置
# assert analysis not in (None, "")
# assert seriousness not in (None, "")
# 用户信息部分
user_info
=
r
[
"data"
][
"user_info"
]
count
=
user_info
[
"count"
]
assert
count
==
1
# 底部按钮
bottom_buttons
=
r
[
"data"
][
"bottom_buttons"
]
assert
bottom_buttons
[
0
][
"gm_url"
]
==
"gengmei://scan_faceimage?face_skin_tab_index=0&has_task=0"
assert
bottom_buttons
[
0
][
"name"
]
==
"AI测颜值"
assert
bottom_buttons
[
1
][
"gm_url"
]
==
"gengmei://transfer_consult?conversation_type=4"
assert
bottom_buttons
[
1
][
"name"
]
==
"变美1V1咨询"
test_backend_case/oneimage_case/test_share_v4.py
View file @
b47b8e4a
...
...
@@ -24,10 +24,23 @@ class TestShareV4:
classification_info
=
r
[
"data"
][
"classification_info"
]
# 测颜值结果,保证五官有值
for
key
,
value
in
classification_info
.
items
():
print
(
key
,
value
[
"name"
],
value
[
"param"
])
#
print(key, value["name"], value["param"])
assert
value
[
"name"
]
is
not
None
assert
value
[
"param"
]
is
not
None
# 颜值报告
content
=
r
[
"data"
][
"tractate_info"
][
"content"
]
print
(
content
)
#
print(content)
assert
content
is
not
None
# 五官描述
info_list
=
r
[
"data"
][
"facial_feature"
][
"info_list"
]
for
item
in
info_list
:
print
(
item
[
"family"
],
item
[
"description"
])
assert
item
[
"family"
]
is
not
None
assert
item
[
"description"
]
is
not
None
# 底部按钮
bottom_buttons
=
r
[
"data"
][
"bottom_buttons"
]
assert
bottom_buttons
[
0
][
"gm_url"
]
==
param
[
"skin_url"
]
assert
bottom_buttons
[
0
][
"name"
]
==
param
[
"skin_name"
]
assert
bottom_buttons
[
1
][
"gm_url"
]
==
param
[
"con_url"
]
assert
bottom_buttons
[
1
][
"name"
]
==
param
[
"con_name"
]
\ No newline at end of file
test_backend_data/oneimage_data/share_v4.yaml
View file @
b47b8e4a
...
...
@@ -4,4 +4,8 @@ share_v4:
case
:
"
请求成功,有数据返回"
version
:
"
7.42.2"
face_id
:
"
15844721"
assert
:
0
\ No newline at end of file
assert
:
0
skin_url
:
"
gengmei://scan_faceimage?face_skin_tab_index=1"
skin_name
:
"
AI测肤质"
con_url
:
"
gengmei://transfer_consult?conversation_type=4"
con_name
:
"
变美1V1咨询"
\ 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