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
0e0c0159
Commit
0e0c0159
authored
Aug 20, 2021
by
张慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
城市筛选器接口case完善
parent
9f9a6ddd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
filter_request.py
all_backend_api/filter_request.py
+1
-3
test_service_home_city_v2.py
test_backend_case/filter_case/test_service_home_city_v2.py
+8
-5
service_home_city_v2.yaml
test_backend_data/filter_data/service_home_city_v2.yaml
+14
-3
No files found.
all_backend_api/filter_request.py
View file @
0e0c0159
...
...
@@ -8,7 +8,6 @@ class filter_request(BaseRequest):
self
.
data
=
self
.
api_load
(
path_setting
.
FILTER_CONFIG
)
def
service_home_city_v2
(
self
,
current_city_id
,
lat
,
lng
):
print
(
"fgx"
)
self
.
params
[
"current_city_id"
]
=
current_city_id
self
.
params
[
"lat"
]
=
lat
self
.
params
[
"lng"
]
=
lng
...
...
@@ -16,8 +15,7 @@ class filter_request(BaseRequest):
if
__name__
==
'__main__'
:
#城市筛选器
#
城市筛选器
print
(
filter_request
()
.
service_home_city_v2
(
""
,
"40.002"
,
"116.487252"
))
print
(
"fgx"
)
test_backend_case/filter_case/test_service_home_city_v2.py
View file @
0e0c0159
...
...
@@ -8,12 +8,15 @@ from all_backend_api.filter_request import filter_request
class
TestServiceHomeCityV2
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
FILTER
)
service
homecityv2_case
,
servicehomecity
v2_data
=
get_ids
(
data
,
"service_home_city_v2"
)
service
_home_city_v2_case
,
service_home_city_
v2_data
=
get_ids
(
data
,
"service_home_city_v2"
)
@pytest.mark.parametrize
(
"param"
,
service
homecityv2_data
,
ids
=
servicehomecity
v2_case
)
@pytest.mark.parametrize
(
"param"
,
service
_home_city_v2_data
,
ids
=
service_home_city_
v2_case
)
def
test_service_home_city_v2
(
self
,
param
):
r
=
filter_request
()
.
service_home_city_v2
(
param
[
"current_city_id"
],
param
[
"lat"
],
param
[
"lng"
])
# print('feng=', r)
if
r
[
"error"
]
==
0
:
assert
len
(
r
[
"data"
][
"area"
])
>
0
if
param
[
"current_city_id"
]
==
"worldwide"
:
assert
r
[
"error"
]
==
param
[
"assert_worldwide"
]
if
param
[
"lat"
]
==
"39.98316321398558"
and
param
[
"lng"
]
==
"116.4881236681604"
:
assert
r
[
"data"
][
"recommend"
][
"located"
][
0
][
"id"
]
==
param
[
"assert_beijing"
]
if
param
[
"lat"
]
==
"45.742347"
and
param
[
"lng"
]
==
"126.661669"
:
assert
r
[
"data"
][
"recommend"
][
"located"
][
0
][
"id"
]
==
param
[
"assert_haerbin"
]
test_backend_data/filter_data/service_home_city_v2.yaml
View file @
0e0c0159
#城市筛选器
service_home_city_v2
:
-
case
:
"
城市筛选器接口"
case
:
"
城市筛选器接口
-current_city_id为空case-经纬度北京
"
current_city_id
:
"
"
lat
:
"
39.98316321398558"
lng
:
"
116.4881236681604"
assert_beijing
:
"
beijing"
-
case
:
"
城市筛选器接口-current_city_id为空case-经纬度哈尔滨"
current_city_id
:
"
"
lat
:
"
45.742347"
lng
:
"
126.661669"
assert_haerbin
:
"
haerbin"
-
case
:
"
城市筛选器接口-全部城市case"
current_city_id
:
"
worldwide"
lat
:
"
40.002"
lng
:
"
116.487252"
assert
:
0
assert_worldwide
:
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