Commit 326a62cb authored by 林颖's avatar 林颖

发帖子--选择标签,医院,订单

parent 59f93653
import path_setting
from in_common.base_request import BaseRequest
class order_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ORDER_CONFIG)
# 我的订单列表
def is_exist(self):
return self.api_send(self.data["is_exist"])
#发帖子用来判断订单是否存在的
is_exist:
method: get
url: /api/order/is_exist
params:
data: {}
json: {}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class tag_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TAG_CONFIG)
# 进入发帖子页面-选择医院
def list(self, level=3, tag_from=1):
self.params["level"] = level
self.params["tag_from"] = tag_from
return self.api_send(self.data["list"])
\ No newline at end of file
#发帖子&写日记&提问题--选择标签--现在默认是三级标签
list:
method: get
url: /api/tag/list
params:
level: ${level}
tag_from: ${tag_from}
data:
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
......@@ -21,8 +21,13 @@ class topic_request(BaseRequest):
self.params["topic_id"] = topic_id
return self.api_send(self.data["detail"])
# 进入发帖子页面-选择医院
def to_hospital_list(self):
return self.api_send(self.data["to_hospital_list"])
# # 进入发帖子页面-选择美购--医生账号没发走暂时注释
# def to_service_list(self):
# return self.api_send(self.data["to_service_list"])
......
......@@ -29,39 +29,24 @@ detail:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#发帖子--选择医院
to_hospital_list:
method: get
url: /api/topic/to_hospital_list
params:
data:
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
##日记贴相关美购--暂时没有
#topic_service:
##发帖子--选择美购【医生账号不走这个接口--一般用户走,医生账号没发走】--所以暂时注释掉
#to_service_list:
# method: get
# url: /api/diary/services
# url: /api/topic/to_service_list
# params:
# diary_id: ${diary_id}
# service_id: ${service_id}
# data:
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
##日记贴一级评论创建[这个是非本身日记贴:21116006]--暂时未解决复写yaml文件的问题所以单独把创建评论踢出去
#reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#
##日记贴二级评论创建[这个是非本身日记贴:21116006]
#sub_reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# replied_id: ${replied_id}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
......@@ -87,15 +87,21 @@ TRACTATE_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_
TRACTATE_PUBLISH_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "publish_reply.yaml")
# 发帖子--帖子内容创建
TRACTATE_CREATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "create.yaml")
# 发帖子--帖子医院选择
TRACTATE_HOSIPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "to_hospital_list.yaml")
# 发帖子--帖子订单选择
TRACTATE_ORDER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/order_data", "is_exist.yaml")
# 发帖子--帖子美购选择
TRACTATE_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "to_service_list.yaml")
# 写日记&提问题&发帖子--标签选择
# 发帖子--帖子订单选择 --也是order的总配置项
ORDER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "order_request.yaml")
TRACTATE_ORDER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/order_data", "is_exist.yaml")
# 写日记&提问题&发帖子--标签选择--也是tag的总配置项
TAG_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tag_request.yaml")
DETAIL_TAG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tag_data", "list.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.order_request import order_request
class TestIsExist:
data = BaseRequest().api_load(path_setting.TRACTATE_ORDER)
is_exsit_case, is_exsit_data = get_ids(data,"is_exist")
@pytest.mark.parametrize("param", is_exsit_data, ids=is_exsit_case)
def test_is_exsit(self,param):
r = order_request().is_exist()
assert r["error"] == 0
assert r["data"]["result"] is True
# if r["error"] == 0:
# assert r["data"]["result"] is True
\ 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.tag_request import tag_request
class TestList:
data = BaseRequest().api_load(path_setting.DETAIL_TAG)
tag_list_case, tag_list_data = get_ids(data,"list")
@pytest.mark.parametrize("param", tag_list_data, ids=tag_list_case)
def test_to_hospital_list(self,param):
r = tag_request().list()
assert r["error"] == 0
assert len(r["data"]) > 0
# if r["error"] == 0:
# assert r["data"]["result"] is True
\ 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.topic_request import topic_request
class TestT0HospitalList:
data = BaseRequest().api_load(path_setting.TRACTATE_HOSIPITAL)
to_hospital_list_case, to_hospital_list_data = get_ids(data,"to_hospital_list")
@pytest.mark.parametrize("param", to_hospital_list_data, ids=to_hospital_list_case)
def test_to_hospital_list(self,param):
r = topic_request().to_hospital_list()
assert r["error"] == 0
assert len(r["data"]) > 0
# if r["error"] == 0:
# assert r["data"]["result"] is True
\ No newline at end of file
to_service_list:
is_exist:
#帖子撰写时选择订单
-
case: "帖子详情页--撰写内容时选择订单"
assert: 0
message: " +1"
message: ""
list:
#详情页tag选择
#详情页tag选择--默认参数tag_from: 1
-
case: "详情页--撰写内容选择标签"
case: "详情页--撰写内容选择标签--发帖子&提问题"
assert: 0
message: " +1"
-
case: "详情页--撰写内容选择标签--写日记&写回答"
assert: 0
tag_from: 0
to_service_list:
to_hospital_list:
#帖子撰写时选择医院
-
case: "帖子详情页--撰写内容时选择医院"
assert: 0
message: " +1"
......
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