Пример #1
0
	def get_groups_component(self, endpoint):
		json_str = CachetApiV1.get_groups_component(endpoint)
		if json_str == None:
			raise Exception(CONST_ERROR_MESSAGE_CACHET_API_V1)		

		json_object = json.loads(json_str)
		group_components_json_array = json_object[CONST_DATA_JSON_ATTR]
		groups_components = []
		for group_component_json in group_components_json_array:
		    name = group_component_json[CONST_NAME_JSON_ATTR]
		    id = group_component_json[CONST_ID_JSON_ATTR]
		    groups_components.append(GroupComponent(id, name))
		return groups_components
Пример #2
0
 def test_get_groups_component_error(self):
     response = CachetApiV1.get_groups_component("http://wrong_url")
     self.assertIsNone(response)