Commit e4459b3c authored by 林颖's avatar 林颖

新增签到相关

parent c46c29eb
...@@ -23,10 +23,11 @@ class user_request(BaseRequest): ...@@ -23,10 +23,11 @@ class user_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.TOPIC_FAVOR_CONFIG) self.data = self.api_load(path_setting.TOPIC_FAVOR_CONFIG)
#日记贴帖子相关-收藏 # 日记贴帖子相关-收藏
def topic_favor(self): def topic_favor(self):
return self.api_send(self.data["favor"]) return self.api_send(self.data["favor"])
#日记贴取消收藏
# 日记贴取消收藏
def topic_canclefavor(self): def topic_canclefavor(self):
return self.api_send(self.data["canclefavor"]) return self.api_send(self.data["canclefavor"])
...@@ -36,7 +37,7 @@ class user_request(BaseRequest): ...@@ -36,7 +37,7 @@ class user_request(BaseRequest):
self.params["from_live"] = from_live self.params["from_live"] = from_live
return self.api_send(self.data['follow_add']) return self.api_send(self.data['follow_add'])
#取消关注 # 取消关注
def follow_del(self,uid,from_live): def follow_del(self,uid,from_live):
self.params["uid"] = uid self.params["uid"] = uid
self.params["from_live"] = from_live self.params["from_live"] = from_live
...@@ -45,14 +46,12 @@ class user_request(BaseRequest): ...@@ -45,14 +46,12 @@ class user_request(BaseRequest):
#我的-日记 # 我的-日记
def my_diary_v2(self, start_num, count): def my_diary_v2(self, start_num, count):
self.params["start_num"] = start_num self.params["start_num"] = start_num
self.params["count"] = count self.params["count"] = count
return self.api_send(self.data["my_diary_v2"]) return self.api_send(self.data["my_diary_v2"])
# 我的-帖子-我发布的 # 我的-帖子-我发布的
...@@ -119,6 +118,19 @@ class user_request(BaseRequest): ...@@ -119,6 +118,19 @@ class user_request(BaseRequest):
return self.api_send(self.data["favors_topics"]) return self.api_send(self.data["favors_topics"])
# 签到--签到基础信息
def base_sign_data(self):
return self.api_send(self.data["base_sign_data"])
# 签到--签到兑换记录
def sign_exchanged(self):
return self.api_send(self.data["sign_exchanged"])
# 签到--日历
def sign_calendar(self,year='2021',month='8'):
self.params["year"] = year
self.params["month"] = month
return self.api_send(self.data["sign_calendar"])
......
...@@ -157,3 +157,33 @@ favors_topics: ...@@ -157,3 +157,33 @@ favors_topics:
isLogin: 1 isLogin: 1
#签到--基础信息
base_sign_data:
method: GET
url: /api/user/base_sign_data
params:
data: {}
json: {}
isLogin: 1
#签到--奖品兑换记录
sign_exchanged:
method: GET
url: /api/user/sign_exchanged
params:
data: {}
json: {}
isLogin: 1
#签到--日历
sign_calendar:
method: GET
url: /api/user/sign_calendar
params:
year: ${year}
month: ${month}
data: {}
json: {}
isLogin: 1
...@@ -148,6 +148,14 @@ FEED_TAB_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_ ...@@ -148,6 +148,14 @@ FEED_TAB_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_
FEED_TAB_SERVICE_DOCTORS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "home_feed.yaml") FEED_TAB_SERVICE_DOCTORS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "home_feed.yaml")
# 签到接口
SIGN = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "base_sign_data.yaml")
# 签到兑换记录
SIGN_EXCHANGED = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "sign_exchanged.yaml")
# 签到日历
SIGN_CALENDAR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "sign_calendar.yaml")
#搜索首页-热门搜索 #搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml") KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml")
......
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.SIGN)
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_favors_diaries(self, param):
r = user_request().base_sign_data()
assert r["error"] == param["assert"]
# 校验字段是否存在
# print(r["data"])
assert r["data"]["wait_time"] is not None and r["data"]["wait_time"] is not "" # 是否关注
assert r["data"]["new_user"] is not None and r["data"]["new_user"] is not "" # 是否关注
assert r["data"]["sign_status"] is not None and r["data"]["sign_status"] is not "" # 是否关注
assert r["data"]["user_id"] is not None and r["data"]["user_id"] is not "" # 是否关注
assert r["data"]["days_to_gift"] is not None and r["data"]["days_to_gift"] is not "" # 是否关注
# assert r["data"] is True
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 TestSignCalendar:
data = BaseRequest().api_load(path_setting.SIGN_CALENDAR)
sign_calendar_case, sign_calendar_data = get_ids(data, "sign_calendar")
@pytest.mark.parametrize("param", sign_calendar_data, ids=sign_calendar_case)
def test_favors_diaries(self, param):
r = user_request().sign_calendar()
assert r["error"] == param["assert"]
assert r["data"]["user_id"] is not None and r["data"]["user_id"] is not "" # 判断用户名是否为空
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 TestSignExchanged:
data = BaseRequest().api_load(path_setting.SIGN_EXCHANGED)
sign_exchanged_case, sign_exchanged_data = get_ids(data, "sign_exchanged")
@pytest.mark.parametrize("param", sign_exchanged_data, ids=sign_exchanged_case)
def test_favors_diaries(self, param):
r = user_request().sign_exchanged()
assert r["error"] == param["assert"]
# 校验字段是否存在
# assert r["data"] is True
base_sign_data:
#签到基础信息
- case: "签到基础信息"
assert: 0
\ No newline at end of file
sign_calendar:
#签到日历
- case: "签到日历"
assert: 0
\ No newline at end of file
sign_exchanged:
#签到奖品兑换记录
- case: "签到奖品兑换记录"
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