class AlterConfig: def __init__(self): self.conf = ReadConfig() self.request = HttpRequest() def alter_sys_config(self, id, value): url = self.conf.get('login', 'address') + '/syscenter/api/v1/config/updateConfig?id=' + str(id) + '&type=input' data = value response = self.request.put(url, data).json() print(response) def alter_default_setting(self, id, code, name, is_use, value): url = self.conf.get('login', 'address') + '/syscenter/api/v1/config/updateDefaultSetting' data = { "id": id, "settingCode": code, "settingName": name, "value": value, "valueType": None, "remark": None, "isUse": is_use, "systemCode": None, "zoneId": None, "typeData": "checkbox" } print('data', data) response = self.request.put(url, data).json() print('response', response)
def test_fail(self, zy, body, xmlname): request = HttpRequest() response = request.put( auditcennter_url + "/api/v1/auditPlan/" + TestMatchPlan.planid, body) zy.send.send("ipt", xmlname, 1) assert (zy.selNotAuditIptList())['data']['engineInfos'] #1