Commit e26521ab authored by 林颖's avatar 林颖

日记本收藏&取消收藏

parent decc614f
#日记本收藏
cancelfavor:
method: delete
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class diary_cancelfavor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_CANCELFAVOR_CONFIG)
def diary_cancelfavor(self):
return self.api_send(self.data["cancelfavor"])
from backend_auto import path_setting
from backend_auto.in_common.base_request import BaseRequest
import path_setting
from in_common.base_request import BaseRequest
class diary_data_reqest(BaseRequest):
class diary_data_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_DATA_CONFIG)
......
#日记本收藏
isfavor:
method: post
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class diary_isfavor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_ISFAVOR_CONFIG)
def diary_isfavor(self):
return self.api_send(self.data["isfavor"])
......@@ -2,7 +2,7 @@ import path_setting
from in_common.base_request import BaseRequest
class diary_service_reqest(BaseRequest):
class diary_service_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_SERVICE_CONFIG)
......
......@@ -13,9 +13,17 @@ DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diar
DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "diary_data.yaml")
#日记本关联美购
DIARY_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_service_request.yaml")
DIARY_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_service.yaml")
DIARY_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_service.yaml")
#日记本收藏
DIARY_ISFAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_isfavor.yaml")
DIARY_ISFAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_isfavor.yaml")
# 日记本取消收藏
DIARY_CANCELFAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_cancelfavor.yaml")
DIARY_CANCELFAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_cancelfavor.yaml")
#搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
......@@ -3,18 +3,18 @@ import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_reqest
from all_backend_api.diary_data_request import diary_data_request
class TestDIARYDATA:
class TestDiaryData:
data = BaseRequest().api_load(path_setting.DIARY_DATA)
diary_data_case, diary_data_data = get_ids(data, "diary_data")
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_data(self,param):
# print(2)
r = diary_data_reqest().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(1)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
......@@ -38,6 +38,3 @@ class TestDIARYDATA:
if r["error"] == 1:
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.diary_cancelfavor_request import diary_cancelfavor_request
class TestDiaryCancelfavor:
data = BaseRequest().api_load(path_setting.DIARY_CANCELFAVOR)
diary_cancelfavor_case, diary_cancelfavor_data = get_ids(data, "diary_cancelfavor")
@pytest.mark.parametrize("param", diary_cancelfavor_data, ids=diary_cancelfavor_case)
def test_diary_cancelfavor(self, param):
r = diary_cancelfavor_request().diary_cancelfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert"]
assert r["message"] ==param["assert2"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_isfavor_request import diary_isfavor_request
class TestDiaryIsfavor:
data = BaseRequest().api_load(path_setting.DIARY_ISFAVOR)
diary_isfavor_case, diary_isfavor_data = get_ids(data, "diary_isfavor")
@pytest.mark.parametrize("param", diary_isfavor_data, ids=diary_isfavor_case)
def test_diary_isfavor(self, param):
r = diary_isfavor_request().diary_isfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert"]
assert r["message"] ==param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
......@@ -3,18 +3,18 @@ import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_reqest
from all_backend_api.diary_data_request import diary_data_request
class TestDIARYDATA:
class TestDiaryService:
data = BaseRequest().api_load(path_setting.DIARY_DATA)
diary_data_case, diary_data_data = get_ids(data, "diary_data")
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_data(self,param):
def test_diary_service(self,param):
# print(2)
r = diary_data_reqest().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(1)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
......
diary_cancelfavor:
#取消收藏case--无须字段
-
case: "取消收藏成功case"
assert: "已取消收藏"
assert2: "请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_isfavor:
#收藏case--无须字段
-
case: "收藏成功case"
assert: "收藏成功"
assert2: "请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
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