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
69c73c6f
Commit
69c73c6f
authored
Jun 09, 2021
by
张伟男
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI推荐日记
parent
0b0be6e5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
0 deletions
+64
-0
face_request.py
all_backend_api/face_request.py
+20
-0
face_request.yaml
all_backend_api/face_request.yaml
+6
-0
path_setting.py
path_setting.py
+4
-0
__init__.py
test_backend_case/face_case/__init__.py
+0
-0
test_diary_cards.py
test_backend_case/face_case/test_diary_cards.py
+28
-0
__init__.py
test_backend_data/face_data/__init__.py
+0
-0
diary_cards.yaml
test_backend_data/face_data/diary_cards.yaml
+6
-0
No files found.
all_backend_api/face_request.py
0 → 100644
View file @
69c73c6f
import
path_setting
from
in_common.base_request
import
BaseRequest
class
face_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
FACE_DIARY_CARDS_CONFIG
)
# 根据多个标签推荐日记
def
diarys_cards
(
self
,
facial_type2tag_names
):
self
.
params
[
"facial_type2tag_names"
]
=
facial_type2tag_names
return
self
.
api_send
(
self
.
data
[
"face_diarys"
])
if
__name__
==
'__main__'
:
facial_type2tag_names
=
'{"2":["玻尿酸垫下巴","自体脂肪垫下巴"],"3":["半永久纹眉","植眉"]}'
print
(
face_request
()
.
diarys_cards
(
facial_type2tag_names
))
all_backend_api/face_request.yaml
0 → 100644
View file @
69c73c6f
face_diarys
:
method
:
get
url
:
/api/face/diary/cards
params
:
facial_type2tag_names
:
${facial_type2tag_names}
\ No newline at end of file
path_setting.py
View file @
69c73c6f
...
@@ -78,6 +78,10 @@ ONEIMAGE_RECOMEND_SERVICES_DATA = os.path.join(BASE_DIR, "backend_auto/test_back
...
@@ -78,6 +78,10 @@ ONEIMAGE_RECOMEND_SERVICES_DATA = os.path.join(BASE_DIR, "backend_auto/test_back
# 测颜值结果页获取小程序二维码
# 测颜值结果页获取小程序二维码
XCX_GENGMEI_GET_WXACODE_UNLIMITED_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"xcx_request.yaml"
)
XCX_GENGMEI_GET_WXACODE_UNLIMITED_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"xcx_request.yaml"
)
XCX_GENGMEI_GET_WXACODE_UNLIMITED_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/xcx_data"
,
"gengmei_get_wxacode_unlimited.yaml"
)
XCX_GENGMEI_GET_WXACODE_UNLIMITED_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/xcx_data"
,
"gengmei_get_wxacode_unlimited.yaml"
)
# 测颜值根据标签召回日记
FACE_DIARY_CARDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"face_request.yaml"
)
FACE_DIARY_CARDS_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/face_data"
,
"diary_cards.yaml"
)
# 测肤结果页 / AI变脸结果页
# 测肤结果页 / AI变脸结果页
GMAI_SKIN_NEWREPORT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"gmai_request.yaml"
)
GMAI_SKIN_NEWREPORT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"gmai_request.yaml"
)
...
...
test_backend_case/face_case/__init__.py
0 → 100644
View file @
69c73c6f
test_backend_case/face_case/test_diary_cards.py
0 → 100644
View file @
69c73c6f
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.face_request
import
face_request
class
TestDiaryCards
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FACE_DIARY_CARDS_DATA
)
FaceDiaryCards_case
,
FaceDiaryCards_data
=
get_ids
(
data
,
"diary_cards"
)
@pytest.mark.parametrize
(
"param"
,
FaceDiaryCards_data
,
ids
=
FaceDiaryCards_case
)
def
test_diary_cards
(
self
,
param
):
r
=
face_request
()
.
diarys_cards
(
param
[
"facial_type2tag_names"
])
if
r
[
"error"
]
==
0
:
feed
=
r
[
"data"
]
assert
len
(
feed
)
==
param
[
"assert_feed_nums"
]
for
key
in
feed
:
diary_cards
=
feed
[
key
]
assert
diary_cards
[
"__source"
]
==
"diary"
assert
diary_cards
[
"title"
]
is
not
None
assert
diary_cards
[
"desc"
]
is
not
None
assert
diary_cards
[
"diary"
]
is
not
None
test_backend_data/face_data/__init__.py
0 → 100644
View file @
69c73c6f
test_backend_data/face_data/diary_cards.yaml
0 → 100644
View file @
69c73c6f
diary_cards
:
-
case
:
"
测颜值根据标签推荐日记"
facial_type2tag_names
:
'
{"2":["玻尿酸垫下巴","自体脂肪垫下巴"],"3":["半永久纹眉","植眉"]}'
assert_feed_nums
:
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