Beispiel #1
0
 def test_dac_03(self):
     """
     用例描述:3. 获取所有设备的信息,"app": "12"
     """
     case_id = "设备信息表"
     logging.info("START TEST CASE: {}".format(case_id))
     test = Assertions()
     request = Send_Request()
     row = data.get_row_by_id(case_id)
     is_run = data.get_is_run(row)
     if is_run:
         url = data.get_request_url(row)
         request_data = data.get_request_data(row)
         token = data.get_token(row)
         request_data['token'] = token
     response = self.print_message(url, request_data)
     assert test.assert_code(response['body']['returnCode'], '200')
     Consts.RESULT_LIST.append('True')
Beispiel #2
0
 def test_dac_02(self):
     """
     用例描述:2. 获取所有设备历史信息,根据用户传入的token,采集参数,时间段以及设备编号获取该时间段内该设备采集参数的所有采集记录
     "app": "2"
     """
     case_id = "历史数据"
     logging.info("START TEST CASE: {}".format(case_id))
     test = Assertions()
     request = Send_Request()
     row = data.get_row_by_id(case_id)
     is_run = data.get_is_run(row)
     if is_run:
         url = data.get_request_url(row)
         request_data = data.get_request_data(row)
         token = data.get_token(row)
         request_data['token'] = token
     response = self.print_message(url, request_data)
     assert test.assert_code(response['body']['returnCode'], '200')
     Consts.RESULT_LIST.append('True')
Beispiel #3
0
 def test_dac_05(self):
     """
     用例描述:5. 获取告警数据,"app": "66"
     """
     case_id = "告警数据"
     logging.info("START TEST CASE: {}".format(case_id))
     test = Assertions()
     request = Send_Request()
     row = data.get_row_by_id(case_id)
     is_run = data.get_is_run(row)
     if is_run:
         url = data.get_request_url(row)
         request_data = data.get_request_data(row)
         token = data.get_token(row)
         request_data['token'] = token
     response = self.print_message(url, request_data)
     assert test.assert_code(response['body']['returnCode'], '200')
     # assert test.assert_value_not_null(response['body']['Values'])
     Consts.RESULT_LIST.append('True')
Beispiel #4
0
 def print_message(self, url, request_data):
     request = Send_Request()
     logging.info("request_data: {}{}".format(request_data,url))
     response = request.post_request(url, data=request_data)
     logging.info("RESPONSE: {}".format(response['body']))
     return response