コード例 #1
0
 def setUpClass(cls) -> None:
     '''获取新增厂商ID'''
     cls.header = OperationHeader().get_header()
     url_firm = globalvar.Base_Url + "/firm/add"
     data_firm = {
         "name": "测试厂商700",
         "code": 700,
         "icon": " 测试厂商11",
         "address": "金绣国际测试地址"
     }
     cls.firmid = requests.post(url=url_firm,
                                data=json.dumps(data_firm),
                                headers=cls.header).json()['result']
     '''获取新增产品ID'''
     cls.header = OperationHeader().get_header()
     url_product = globalvar.Base_Url + "/product/add"
     data_product = {
         "firmId": cls.firmid,
         "name": "test product",
         "code": 800,
         "ability": 512
     }
     cls.productid = requests.post(url=url_product,
                                   data=json.dumps(data_product),
                                   headers=cls.header).json()['result']
     '''读测试用例sheet'''
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                        sheetName='product_edit')
     cls.run_method = RunMethod()
     cls.com_util = CommonUtil()
コード例 #2
0
 def setUpClass(cls) -> None:
     '''读测试用例sheet'''
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                        sheetName='firm_add')
     cls.run_method = RunMethod()
     cls.com_util = CommonUtil()
     '''获取token'''
     cls.header = OperationHeader().get_header()
コード例 #3
0
 def setUpClass(cls) -> None:
     '''获取新增厂商ID'''
     cls.header = OperationHeader().get_header()
     url = globalvar.Base_Url + "/firm/add"
     data = {"name": "测试厂商700", "code":700, "icon":" 测试厂商11", "address":"金绣国际测试地址"}
     cls.firmid = requests.post(url=url, data=json.dumps(data), headers=cls.header).json()['result']
     '''读测试用例sheet'''
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='firm_del')
     cls.run_method = RunMethod()
     cls.com_util = CommonUtil()
コード例 #4
0
ファイル: test_room_add.py プロジェクト: stinazhang/domiapi
 def setUpClass(cls) -> None:
     '''获取新增家庭ID'''
     cls.header = OperationHeader().get_header()
     url = globalvar.Base_Url + "/scene/add"
     data = {"name": "002 testhome"}
     cls.sceneid = requests.post(url=url, data=json.dumps(data), headers=cls.header).json()['result']
     '''读测试用例sheet'''
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='room_add')
     cls.run_method = RunMethod()
     cls.com_util = CommonUtil()
コード例 #5
0
ファイル: test_scene_add.py プロジェクト: stinazhang/domiapi
 def setUpClass(cls) -> None:
     "登录"
     url = globalvar.Base_Url + "/account/login"
     data = {
         "username": "******",
         "password": "******",
         "appId": "1469503131678220288"
     }
     header = {"Content-Type": "application/json"}
     requests.post(url=url, data=json.dumps(data), headers=header)
     cls.run_method = RunMethod()
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                        sheetName='scene_add')
     cls.com_util = CommonUtil()
     cls.send_email = SendEmail()
コード例 #6
0
ファイル: test_scene_edit.py プロジェクト: stinazhang/domiapi
 def setUpClass(cls) -> None:
     # "登录"
     # url = globalvar.Base_Url + "/account/login"
     # data = {"username": "******", "password": "******", "appId": "1469503131678220288"}
     # header = {"Content-Type": "application/json"}
     # requests.post(url=url, data=json.dumps(data), headers=header)
     cls.run_method = RunMethod()
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                        sheetName='scene_edit')
     cls.com_util = CommonUtil()
     cls.header = OperationHeader().get_header()
     '获取新增场景ID'
     url = globalvar.Base_Url + "/scene/add"
     data = {"name": "002 test home"}
     cls.sceneid = requests.post(url=url,
                                 data=json.dumps(data),
                                 headers=cls.header).json()['result']
コード例 #7
0
ファイル: test_login.py プロジェクト: stinazhang/domiapi
 def setUp(self) -> None:
     self.run_method = RunMethod()
     self.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                         sheetName='login')
     self.com_util = CommonUtil()
コード例 #8
0
ファイル: test_scene_del.py プロジェクト: stinazhang/domiapi
 def setUpClass(cls) -> None:
     cls.run_method = RunMethod()
     cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls',
                        sheetName='scene_del')
     cls.com_util = CommonUtil()
コード例 #9
0
 def __init__(self):
     self.run_method = RunMethod()
     self.data = GetData()
     self.com_util = CommonUtil()
     self.send_mai = SendEmail()