Commit 915b4918 authored by 冯艮霞's avatar 冯艮霞

签到情况

parent c68e4a48
import path_setting
from in_common.base_request import BaseRequest
class polymerization_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.POLYMERIZATION_CONFIG)
def content(self, tabtype, category_polymer_id, page, tag_ids, operation_id, level, device_id, current_city_id, version):
self.params["tabtype"] = tabtype
self.params["category_polymer_id"] = category_polymer_id
self.params["page"] = page
self.params["tag_ids"] = tag_ids
self.params["operation_id"] = operation_id
self.params["level"] = level
self.params["device_id"] = device_id
self.params["current_city_id"] = current_city_id
self.params["version"] = version
return self.api_send(self.data["content"])
if __name__ == '__main__':
print(polymerization_request().content("home_video", "39", "1", "[3239, 3242, 3243, 3245, 3246, 3247, 3248, 3275, 3277, 3278, 3279, 3289, 3309]", "12", "1", "869378034450718", "beijing", "7.45.0"))
#品类聚合页面社区和视频tab
content:
method: get
url: /api/polymerization/content
params:
tabtype: ${tabtype}
category_polymer_id: ${category_polymer_id}
page: ${page}
tag_ids: ${tag_ids}
operation_id: ${operation_id}
level: ${level}
device_id: ${device_id}
current_city_id: ${current_city_id}
version: ${version}
data: {}
json: {}
isLogin: 1
......@@ -112,9 +112,37 @@ class user_request(BaseRequest):
return self.api_send(self.data["favors_answers"])
# 我的-粉丝和关注
def following_or_fans(self, start_num, uid, type, version, current_city_id, device_id):
self.params["start_num"] = start_num
self.params["uid"] = uid
self.params["type"] = type
self.params["version"] = version
self.params["current_city_id"] = current_city_id
self.params["device_id"] = device_id
return self.api_send(self.data["following_or_fans"])
# 签到情况
def base_sign_data(self, client_source, json, version, device_id):
self.params["client_source"] = client_source
self.params["json"] = json
self.params["version"] = version
self.params["device_id"] = device_id
return self.api_send(self.data["base_sign_data"])
if __name__ == '__main__':
#签到情况
print(user_request().base_sign_data("app", "", "7.45.0", "869378034450718"))
# 我的-我的粉丝
print(user_request().following_or_fans(0, "33910245", "fans", "7.45.0", "beijing", "androidid_16a95f3fa31a4c0b"))
#个人中心
print(user_request().personal_center())
......@@ -154,3 +182,5 @@ if __name__ == '__main__':
......@@ -136,4 +136,32 @@ favors_answers:
count: ${count}
data: {}
json: {}
isLogin: 1
# 我的-粉丝和关注
following_or_fans:
method: GET
url: /api/user/following_or_fans
params:
start_num: ${start_num}
uid: ${uid}
type: ${type}
version: ${version}
current_city_id: ${current_city_id}
device_id: ${device_id}
data: {}
json: {}
isLogin: 1
# 我的-粉丝和关注
base_sign_data:
method: GET
url: /api/user/base_sign_data
params:
version: ${version}
client_source: ${client_source}
json: ${json}
device_id: ${device_id}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -452,5 +452,18 @@ FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_da
ACCOUNT_HOMEPAGE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
ACCOUNT_HOMEPAGE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "account_homepage.yaml")
#我的-我的粉丝
FOLLOWING_OR_FANS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
FOLLOWING_OR_FANS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "following_or_fans.yaml")
#品类聚合页-社区
POLYMERIZATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "polymerization_request.yaml")
POLYMERIZATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/polymerization_data", "polymerization_content.yaml")
#签到情况
BASE_SIGN_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
BASE_SIGN_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "base_sign_data.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.polymerization_request import polymerization_request
class TestPolymerizationContent:
data = BaseRequest().api_load(path_setting.POLYMERIZATION)
polymerization_content_case, polymerization_content_data = get_ids(data, "polymerization_content")
@pytest.mark.parametrize("param", polymerization_content_data, ids=polymerization_content_case)
def test_content(self, param):
r = polymerization_request().content(param["tabtype"], param["category_polymer_id"], param["page"], param["tag_ids"], param["operation_id"], param["level"],param["device_id"], param["current_city_id"], param["version"])
assert r["error"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestBaseSignData:
data = BaseRequest().api_load(path_setting.BASE_SIGN_DATA)
base_sign_data_case, base_sign_data_data = get_ids(data, "base_sign_data")
@pytest.mark.parametrize("param", base_sign_data_data, ids=base_sign_data_case)
def test_fbase_sign_data(self, param):
r = user_request().base_sign_data(param["client_source"], param["json"], param["version"], param["device_id"])
assert r["error"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestFollowingOrFans:
data = BaseRequest().api_load(path_setting.FOLLOWING_OR_FANS)
following_or_fans_case, following_or_fans_data = get_ids(data, "following_or_fans")
@pytest.mark.parametrize("param", following_or_fans_data, ids=following_or_fans_case)
def test_following_or_fans(self, param):
r = user_request().following_or_fans(param["start_num"], param["uid"], param["type"], param["version"], param["current_city_id"], param["device_id"])
assert r["error"] == param["assert"]
polymerization_content:
#品类聚合页社区tab
-
case: "品类聚合页面社区tab"
tabtype: home_video
category_polymer_id: 39
page: 1
tag_ids: [3239, 3242, 3243, 3245, 3246, 3247, 3248, 3275, 3277, 3278, 3279, 3289, 3309]
operation_id: 12
level: 1
device_id: 869378034450718
current_city_id: beijing
version: 7.45.0
assert: 0
-
case: "品类聚合页面视频tab"
tabtype: choice
category_polymer_id: 39
page: 1
tag_ids: [3239, 3242, 3243, 3245, 3246, 3247, 3248, 3275, 3277, 3278, 3279, 3289, 3309]
operation_id: 12
level: 1
device_id: 869378034450718
current_city_id: beijing
version: 7.45.0
assert: 0
base_sign_data:
#签到情况
-
case: "签到情况"
client_source: app
json:
version: 7.45.0
device_id: 869378034450718
assert: 0
following_or_fans:
#我的-粉丝和关注
-
case: "我的-我的粉丝"
start_num: 0
uid: 33910245
type: fans
version: 7.45.0
current_city_id: beijing
device_id: androidid_16a95f3fa31a4c0b
assert: 0
-
case: "我的-我的关注"
start_num: 0
uid: 33910245
type: following
version: 7.45.0
current_city_id: beijing
device_id: androidid_16a95f3fa31a4c0b
assert: 0
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