def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.headers = RunMain().headers() self.baseurl = url.baseurl() self.version = ReadConfig().get_app("version") self.app_key = ReadConfig().get_app("app_key") self.aes = AES_CBC()
# @Time : 2019/7/10 10:23 # @Author: pengjuan # @interfacetest: http://apiv1.starschina.com/cms/v1.2/page from common.configHttp import RunMain from readConfig import ReadConfig from common.getSign import get_Sign from common.AES_CBC import AES_CBC from datetime import datetime import common.url as url import requests, unittest, json, time baseurl = url.baseurl() version = ReadConfig().get_app('version') app_key = ReadConfig().get_app('app_key') aes = AES_CBC() headers = RunMain().headers() class test_Page(unittest.TestCase): """测试页面加载接口""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.url = baseurl + "/cms/v1.2/page" def get_config_page_id(self): # id需要在config接口中返回 timeStamp = int(time.mktime(datetime.now().timetuple())) data = '{"os_type": 1,' \ '"app_key":"%(app_key)s",' \ '"os_version":"9",' \