Пример #1
0
	def create_metric_point(self, endpoint, metric_point, token):
		json_str = CachetApiV1.create_metric_point(endpoint, metric_point.get_metric_id(), metric_point.get_value(), metric_point.get_timestamp(), token)
		if json_str == None:
			raise Exception(CONST_ERROR_MESSAGE_CACHET_API_V1)

		json_object = json.loads(json_str)
		metric_point_json = json_object[CONST_DATA_JSON_ATTR]
		id = metric_point_json[CONST_ID_JSON_ATTR]
		return Metric(id=id)
Пример #2
0
 def test_create_metric_point(self):
     response = CachetApiV1.create_metric_point("http://wrong_url",
                                                "metric_id", "value_point",
                                                "timestamp", "token")
     self.assertIsNone(response)