Commit 022af858 authored by 张伟男's avatar 张伟男

ceshi

parent 42c6066e
import path_setting
from in_common.base_request import BaseRequest
class feed_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.FEED_INDEXV9_CONFIG)
def index_v9(self,tabtype,version,current_city_id):
self.params["tabtype"] = tabtype
self.params["version"] = version
self.params["current_city_id"] = current_city_id
return self.api_send(self.data["index_v9"])
if __name__ == '__main__':
print(feed_request().index_v9("choice", "7.42.2", "beijing"))
\ No newline at end of file
index_v9:
method: get
url: /api/feed/index/v9
params:
tabtype: ${tabtype}
version: ${version}
current_city_id: ${current_city_id}
data:
json: {}
......@@ -7,5 +7,8 @@ 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")
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")
if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG)
......@@ -20,5 +20,3 @@ class TestLoginVfc:
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestIndexV9:
data = BaseRequest().api_load(path_setting.FEED_INDEXV9_DATA)
indexv9_case, indexv9_data = get_ids(data, "index_v9")
@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:
features = r.get("data").get("features",[])
assert len(features) > param["assert"]
index_v9:
#成功登录case
-
case: "请求成功,有数据返回"
current_city_id: "beijing"
tabtype: "choice"
version: "7.42.2"
assert: 0
\ No newline at end of file
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