def setUpClass(cls): cls.maxDiff = None # get old process_list process_list_pre = get_process_list()['processes'] # add new component add_process(PROCESS_WITHOUT_TARGET_METRICS) # get new process_list process_list_post = get_process_list()['processes'] cls.uid = None cls.componentUid = None for post_uid in process_list_post: if post_uid not in process_list_pre: cls.uid = post_uid['uid'] UID_DICT["uid"] = cls.uid PROCESS_WITHOUT_TARGET_METRICS["process"]["uid"] = cls.uid component_list_pre = get_component_list()['components'] # add new component add_component(ADD_COMPONENT_IN) component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid not in component_list_pre: cls.componentUid = post_uid['uid'] ADD_PROCESS_REFERENCE["process_uid"] = cls.uid ADD_PROCESS_REFERENCE["component_uid"] = cls.componentUid add_process_reference(ADD_PROCESS_REFERENCE)
def setUpClass(cls): component_list_pre = get_component_list()['components'] # add new component add_component(ADD_COMPONENT_IN) component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid not in component_list_pre: cls.uid = post_uid['uid']
def setUpClass(cls): component_list_pre = get_component_list()['components'] # add new component for i in range(0, cls.amount): add_component(ADD_COMPONENT_IN) component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid not in component_list_pre: cls.uid.append(post_uid['uid'])
def tearDownClass(cls): component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid not in cls.component_list_pre: GET_COMPONENT_IN['uid'] = post_uid['uid'] delete_component(GET_COMPONENT_IN)
def tearDown(self): component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid in self.component_list_pre: continue GET_COMPONENT_IN['uid'] = post_uid['uid'] delete_component(GET_COMPONENT_IN)
def setUp(self): add_component(ADD_COMPONENT_IN) component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid in self.component_list_pre: continue self.uid = post_uid['uid'] DELETE_COMPONENT_IN['uid'] = self.uid GET_COMPONENT_IN['uid'] = self.uid
def test_1301_correct_inputs(self): result = add_component(ADD_COMPONENT_IN) self.assertEqual(result, ADD_COMPONENT_OUT) component_list_post = get_component_list()['components'] for post_uid in component_list_post: if post_uid in self.component_list_pre: continue GET_COMPONENT_IN['uid'] = post_uid['uid'] self.assertTrue(get_component(GET_COMPONENT_IN)['success'])
def get_component_list() -> str: """ Calls the get_component_list method and converts the output to JSON :return: Returns a JSON object, structured as described in docu/JSON_objects_definitions.py """ component_list_dict = component_handler.get_component_list() output_json = processing.dict_to_json(component_list_dict) return output_json
def test_1402_correct_content_of_dict(self): result = get_component_list() components_to_be_deleted = [] for component in result['components']: if component['uid'] not in self.uid: components_to_be_deleted.append(component) else: dict = component del dict['creation_timestamp'] del dict['last_timestamp'] for component in components_to_be_deleted: result['components'].remove(component) self.assertEqual(result, GET_COMPONENT_LIST_OUT)
def setUpClass(cls): cls.component_list_pre = get_component_list()['components']