def test_record_result_data(self, mock_requests): type(mock_requests.post.return_value).status_code = 204 influxdb = InfluxdbDispatcher(self.yardstick_conf) data = { 'status': 1, 'result': { 'criteria': 'PASS', 'info': {}, 'task_id': 'b9e2bbc2-dfd8-410d-8c24-07771e9f7979', 'testcases': {} } } self.assertEqual(influxdb.flush_result_data(data), 0)
def test_record_result_data(self, mock_requests): type(mock_requests.post.return_value).status_code = 204 influxdb = InfluxdbDispatcher(None, self.yardstick_conf) self.assertEqual(influxdb.record_result_data(self.data1), 0) self.assertEqual(influxdb.record_result_data(self.data2), 0) self.assertEqual(influxdb.flush_result_data(), 0)
def test_record_result_data(self, mock_requests): type(mock_requests.post.return_value).status_code = 204 influxdb = InfluxdbDispatcher(None) self.assertEqual(influxdb.record_result_data(self.data1), 0) self.assertEqual(influxdb.record_result_data(self.data2), 0) self.assertEqual(influxdb.flush_result_data(), 0)