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
4f13b3a1
Commit
4f13b3a1
authored
Apr 16, 2021
by
aha
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cuixin_dev' into common_dev
搜索首页-热门搜索
parents
968ea294
0d1d4610
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
0 deletions
+54
-0
search_request.py
all_backend_api/search_request.py
+14
-0
search_request.yaml
all_backend_api/search_request.yaml
+11
-0
path_setting.py
path_setting.py
+2
-0
test_keywords.py
test_backend_case/search_case/test_keywords.py
+19
-0
keywords.yaml
test_backend_data/search_data/keywords.yaml
+8
-0
No files found.
all_backend_api/search_request.py
View file @
4f13b3a1
import
path_setting
from
in_common.base_request
import
BaseRequest
class
search_request
(
BaseRequest
):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
KEYWORDS_CONFIG
)
#搜索首页-热门搜索模块(点击搜索框即调接口)
def
keywords
(
self
,
current_city_id
,
search_tab
):
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"search_tab"
]
=
search_tab
return
self
.
api_send
(
self
.
data
[
"keywords"
])
\ No newline at end of file
all_backend_api/search_request.yaml
View file @
4f13b3a1
keywords
:
method
:
get
#接口地址
url
:
/api/search/keywords
#列出所有定义函数时的参数
params
:
current_city_id
:
${current_city_id}
search_tab
:
${search_tab}
data
:
{}
json
:
{}
\ No newline at end of file
path_setting.py
View file @
4f13b3a1
...
...
@@ -6,6 +6,8 @@ sys.path.append(BASE_DIR)
HOSTYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto"
,
"host.yaml"
)
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
KEYWORDS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
KEYWORDS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"keywords.yaml"
)
FEED_INDEXV9_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"feed_request.yaml"
)
FEED_INDEXV9_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/feed_data"
,
"index_v9.yaml"
)
...
...
test_backend_case/search_case/test_keywords.py
0 → 100644
View file @
4f13b3a1
import
pytest
import
path_setting
from
all_backend_api.search_request
import
search_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#搜索首页-热门搜索
class
TestKeywords
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
KEYWORDS
)
keywords_case
,
keywords_data
=
get_ids
(
data
,
"keywords"
)
@pytest.mark.parametrize
(
"param"
,
keywords_data
,
ids
=
keywords_case
)
def
test_keywords
(
self
,
param
):
r
=
search_request
()
.
keywords
(
param
[
"current_city_id"
],
param
[
"search_tab"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
print
(
"接口调用成功了~"
)
test_backend_data/search_data/keywords.yaml
0 → 100644
View file @
4f13b3a1
keywords
:
-
#进入搜索首页
case
:
"
进入搜索首页-成功调用搜索首页接口"
current_city_id
:
"
beijing"
search_tab
:
"
0"
assert
:
0
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