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
0d1d4610
Commit
0d1d4610
authored
Apr 16, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索首页-热门搜索接口
parent
42c6066e
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 @
0d1d4610
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 @
0d1d4610
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 @
0d1d4610
...
...
@@ -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"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
HOSTYAML_CONFIG
)
test_backend_case/search_case/test_keywords.py
0 → 100644
View file @
0d1d4610
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 @
0d1d4610
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