Commit a3c5d408 authored by 林颖's avatar 林颖

增加接口默认·参数

parent 19ce88a2
......@@ -10,10 +10,11 @@ class feed_request(BaseRequest):
self.data = self.api_load(path_setting.FREE_RECRUIT_BANNER_CONFIG)
def index_v9(self,tabtype,version,current_city_id):
def index_v9(self,tabtype,version,current_city_id,tab_id='0'):
self.params["tabtype"] = tabtype
self.params["version"] = version
self.params["current_city_id"] = current_city_id
self.params["tab_id"] = tab_id
return self.api_send(self.data["index_v9"])
......
......@@ -5,6 +5,7 @@ index_v9:
tabtype: ${tabtype}
version: ${version}
current_city_id: ${current_city_id}
tab_id: ${tab_id}
data:
json: {}
isLogin: 1
......
......@@ -12,9 +12,18 @@ class TestIndexV9:
@pytest.mark.parametrize("param",indexv9_data,ids=indexv9_case)
def test_index_v9(self,param):
r = feed_request().index_v9(param["tabtype"], param["version"], param["current_city_id"])
if r["error"] == 0:
if param['tabtype'] == "customize_commodity" :
r = feed_request().index_v9(param["tabtype"],param["version"],param["current_city_id"],param['tab_id'])
assert r["error"] == 0
features = r.get("data").get("features",[])
assert len(features) > param["assert"]
else:
r = feed_request().index_v9(param["tabtype"],param["version"], param["current_city_id"])
if r["error"] == 0:
features = r.get("data").get("features",[])
assert len(features) > param["assert"]
......@@ -7,14 +7,15 @@ index_v9:
version: "7.42.2"
assert: 0
- case: "推荐内容/接口请求成功,有数据返回"
- case: "直播tab请求成功,有数据返回"
current_city_id: "beijing"
tabtype: "home_video"
version: "7.42.2"
assert: 0
- case: "直播tab接口请求成功,有数据返回"
- case: "推荐内容/接口接口请求成功,有数据返回 "
current_city_id: "beijing"
tabtype: "customize_commodity"
version: "7.42.2"
assert: 0
\ No newline at end of file
version: 7.47.1
assert: 0
tab_id: 96
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment