You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
from suds.client import Client
|
|
|
|
|
from config import global_data
|
|
|
|
|
from lib.soap_req import req
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GetShowDays:
|
|
|
|
|
def __init__(self, data):
|
|
|
|
|
self.api_name = 'get_show_days'
|
|
|
|
|
self.ws_client = Client(data['basic_data']['url_ws'], cache=None)
|
|
|
|
|
self.ws_client.set_options(location=data['basic_data']['url_ws'])
|
|
|
|
|
self.user_name = data['basic_data']['user_name'] # 固定写死的参数
|
|
|
|
|
self.password = data['basic_data']['password'] # 固定写死的参数
|
|
|
|
|
self.cinema_id = data['basic_data']['cinema_id']
|
|
|
|
|
|
|
|
|
|
def prepare(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def request(self):
|
|
|
|
|
# 准备请求数据
|
|
|
|
|
self.prepare()
|
|
|
|
|
# 准备数据
|
|
|
|
|
data = {
|
|
|
|
|
'UserName': self.user_name, # 授权用户名
|
|
|
|
|
'Password': self.password, # 授权密码
|
|
|
|
|
'CinemaId': self.cinema_id, # 影院三位编码
|
|
|
|
|
}
|
|
|
|
|
# 发送请求
|
|
|
|
|
result_xml = self.ws_client.service.getShowDays(**data)
|
|
|
|
|
# 处理返回数据格式
|
|
|
|
|
result_dict = req(self.api_name, data, result_xml)
|
|
|
|
|
# 处理返回数据
|
|
|
|
|
self.handle()
|
|
|
|
|
# 返回数据用于记录测试结果
|
|
|
|
|
return data, result_xml, result_dict
|
|
|
|
|
|
|
|
|
|
def handle(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
api = GetShowDays(global_data)
|
|
|
|
|
api.request()
|