Commit d8b8f2b8 authored by 林颖's avatar 林颖

日记相关

parent 5c3893ec
#查看日记本相册页面
album:
method: get
url: /hybrid/diary/album/17586198/_data
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_album_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_ALBUM_CONFIG)
def diary_album(self):
return self.api_send(self.data["album"])
......@@ -6,7 +6,7 @@ cancelfavor:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
......
......@@ -10,7 +10,7 @@ class diary_cancelfavor_request(BaseRequest):
def diary_cancelfavor(self):
return self.api_send(self.data["cancelfavor"])
#
#日记本修改信息
operation:
method: post
url: /api/diary/additional_info/v2
params:
data:
diary_id: ${diary_id}
title: ${title}
operation_timestamp: ${operation_timestamp}
doctor_name: ${doctor_name}
hospital_name: ${hospital_name}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看日记修改信息页面
additional_info:
method: get
url: /api/diary/operation/17586198/
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_operation_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_OPERATION_CONFIG)
def diary_operation(self, diary_id, title, operation_timestamp, doctor_name, hospital_name):
self.params["diary_id"] = diary_id
self.params["title"] = title
self.params["operation_timestamp"] = operation_timestamp
self.params["doctor_name"] = doctor_name
self.params["hospital_name"] = hospital_name
return self.api_send(self.data["operation"])
def diary_additional_info(self):
return self.api_send(self.data["operation"])
# def __init__(self):
# self.data = self.api_load(path_setting.DIARY_OPERATION_RESULT_CONFIG)
#
# def diary_additional_info(self):
# return self.api_send(self.data["diary_additional_info"])
# if __name__ == '__main__':
# print(conversation_request().message_read("beijing", 1,'[10622,10626,10646,10651]'))
#更新日记本的修改信息
update:
method: post
url: /api/diary/update_v2/17586198
params:
data:
topic_list: ${topic_list}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_update_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_UPDATE_CONFIG)
def diary_update(self, topic_list):
self.params["topic_list"] = topic_list
return self.api_send(self.data["update"])
......@@ -26,6 +26,20 @@ DIARY_ISFAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "
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")
# 日记本修改日记信息operation--目前好像直接用接口写无权限稍后解决
DIARY_OPERATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_operation.yaml")
DIARY_OPERATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_operation.yaml")
# 日记本创建日记贴信息-
DIARY_UPDATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_update.yaml")
DIARY_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_update.yaml")
# 日记本进入相册页
DIARY_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_album.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_album.yaml")
#搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_album_request import diary_album_request
class TestDiaryAlbum:
data = BaseRequest().api_load(path_setting.DIARY_ALBUM)
diary_album_case, diary_album_data = get_ids(data, "diary_album")
@pytest.mark.parametrize("param", diary_album_data, ids=diary_album_case)
def test_diary_album(self, param):
r = diary_album_request().diary_album()
# print(r)
if r["error"] == 0:
assert r["data"][2]["images"][0]["is_cover"] == param["assert"]
assert r["data"][0]["images"][0]["is_cover"] == param["assert2"]
......@@ -17,10 +17,10 @@ class TestDiaryCancelfavor:
if r["error"] == 0:
assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] ==param["assert2"]
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_operation_request import diary_operation_request
class TestDiaryOperation:
data = BaseRequest().api_load(path_setting.DIARY_OPERATION)
diary_operation_case, diary_operation_data = get_ids(data, "diary_operation")
@pytest.mark.parametrize("param", diary_operation_data, ids=diary_operation_case)
def test_diary_operation(self, param):
r = diary_operation_request().diary_operation(param["diary_id"], param["title"], param["operation_timestamp"], param["doctor_name"], param["hospital_name"])
result = diary_operation_request().diary_additional_info()
if result["error"] == 1:
assert r["message"] == param["assert"]
# if r["error"] == 1:
# 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_update_request import diary_update_request
class TestDiaryUpdate:
data = BaseRequest().api_load(path_setting.DIARY_UPDATE)
diary_update_case, diary_update_data = get_ids(data, "diary_update")
@pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case)
def test_diary_update(self, param):
r = diary_update_request().diary_update(param["topic_list"])
# print(r)
# if r["error"] == 0:
# assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
diary_album:
#进入日记本相册case--无须字段
-
case: "进入日记本相册case"
assert: false
assert2: true
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
......@@ -6,7 +6,7 @@ diary_cancelfavor:
assert2: "请登录后再试"
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
......
diary_operation:
#修改日记本信息case--
-
case: "修改信息"
diary_id: 17586198
title : "上海哈哈哈哈哈哈哈哈哈哈哈虎骨"
operation_timestamp: 1620662400
doctor_name: "也一样"
hospital_name: "一样一样"
assert: "没有权限"
-
case: "将原来的修改内容修改回去,方便下次接着使用"
diary_id: 17586198
title: "测试"
operation_timestamp: 1620662401
doctor_name: "测试"
hospital_name: "测试"
assert: "没有权限"
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_update:
#创建更新日记本信息case--创建新的日记贴
-
case: "发布成功--校验"
topic_list: '[{"content":"呵呵呵呵呵","images":[{"image":"2021/06/04/1545/b9ed9f0dc883"}],"operation_timestamp":"1622792725"}]'
status: true
assert: "没有权限"
isLogin: 1
#
#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