Commit f7b82a29 authored by aha's avatar aha

Merge branch 'common_dev' of http://git.wanmeizhensuo.com/dengyingying/backend_auto into common_dev

parents 7e0cc8a3 66fbb5d2
......@@ -14,8 +14,18 @@ class account_request(BaseRequest):
self.params["face_token"] = face_token
return self.api_send(self.loginvfc["login_vfc"])
# 我的-头像点击
def account_homepage(self, user_id, device_id):
self.params["user_id"] = user_id
self.params["device_id"] = device_id
return self.api_send(self.loginvfc["account_homepage"])
if __name__ == '__main__':
# print(account_request().user_info())
print(account_request.loginvfc(""))
\ No newline at end of file
print(account_request.loginvfc(""))
print(account_request().account_homepage("33910245", "androidid_16a95f3fa31a4c0b"))
\ No newline at end of file
......@@ -12,3 +12,12 @@ login_vfc:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
account_homepage:
method: get
url: /api/account/homepage
params:
user_id: ${user_id}
device_id: ${device_id}
data:
json: {}
isLogin: 1
\ No newline at end of file
......@@ -119,6 +119,21 @@ class user_request(BaseRequest):
return self.api_send(self.data["favors_topics"])
# 我的-收藏-帖子
def favors_tractate(self, page, count):
self.params["page"] = page
self.params["count"] = count
return self.api_send(self.data["favors_tractate"])
# 我的-收藏-回答
def favors_answers(self, page, count):
self.params["page"] = page
self.params["count"] = count
return self.api_send(self.data["favors_answers"])
......@@ -158,6 +173,12 @@ if __name__ == '__main__':
# 我的-收藏-日记贴
print(user_request().favors_topics(0, 10))
# 我的-收藏-帖子
print(user_request().favors_tractate(1, 10))
# 我的-收藏-帖子
print(user_request().favors_answers(1, 10))
......@@ -157,3 +157,25 @@ favors_topics:
isLogin: 1
# 我的-收藏-帖子
favors_tractate:
method: GET
url: /api/user/favors/tractate
params:
page: ${page}
count: ${count}
data: {}
json: {}
isLogin: 1
# 我的-收藏-回答
favors_answers:
method: GET
url: /api/user/favors/answers
params:
page: ${page}
count: ${count}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -711,5 +711,18 @@ FAVORS_TOPICS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data
#直播-新增标签
TAG_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tag_request.yaml")
TAG_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tag_data", "tag_add.yaml")
#我的-收藏-帖子
FAVORS_TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
FAVORS_TRACTATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "favors_tractate.yaml")
#我的-收藏-帖子
FAVORS_ANSWERS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
FAVORS_ANASWERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "favors_answers.yaml")
#我的-头像点击
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")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
\ No newline at end of file
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.account_request import account_request
class TestAccount_Homepage:
data = BaseRequest().api_load(path_setting.ACCOUNT_HOMEPAGE)
account_homepage_case, account_homepage_data = get_ids(data, "account_homepage")
@pytest.mark.parametrize("param", account_homepage_data, ids=account_homepage_case)
def test_account_homepage(self, param):
r = account_request().account_homepage(param["user_id"], 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 TestFavorsAnswers:
data = BaseRequest().api_load(path_setting.FAVORS_ANASWERS)
favors_answers_case, favors_answers_data = get_ids(data, "favors_answers")
@pytest.mark.parametrize("param", favors_answers_data, ids=favors_answers_case)
def test_favors_answers(self, param):
r = user_request().favors_answers(param["page"], param["count"])
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 TestFavorsTractate:
data = BaseRequest().api_load(path_setting.FAVORS_TRACTATE)
favors_tractate_case, favors_tractate_data = get_ids(data, "favors_tractate")
@pytest.mark.parametrize("param", favors_tractate_data, ids=favors_tractate_case)
def test_favors_tractate(self, param):
r = user_request().favors_tractate(param["page"], param["count"])
assert r["error"] == param["assert"]
account_homepage:
#我的-头像点击
-
case: "我的页面-头像点击"
user_id: 33910245
device_id: androidid_16a95f3fa31a4c0b
assert: 0
favors_answers:
#我的-收藏-回答
-
case: "我的页面-收藏-回答"
page: 1
count: 10
assert: 0
favors_tractate:
#我的-收藏-帖子
-
case: "我的页面-收藏-帖子"
page: 1
count: 10
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