示例#1
0
	def create_group_component(self, endpoint, group_component, token):
		json_str = CachetApiV1.create_group_component(endpoint, group_component.get_name(), token)
		if json_str == None:
			raise Exception(CONST_ERROR_MESSAGE_CACHET_API_V1)
		
		json_object = json.loads(json_str)
		group_component_json = json_object[CONST_DATA_JSON_ATTR]
		id = group_component_json[CONST_ID_JSON_ATTR]
		name = group_component_json[CONST_NAME_JSON_ATTR]
		return Component(id=id, name=name)
示例#2
0
 def test_create_group_component_error(self):
     response = CachetApiV1.create_group_component("http://wrong_url",
                                                   "name", "token")
     self.assertIsNone(response)