Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    def test_1102_incorrect_uids(self):

        uids_to_be_tested = [1.5, 'abc', '123456789']

        for uid in uids_to_be_tested:
            DELETE_COMPONENT_IN['uid'] = uid

            with self.assertRaises(CypherSyntaxError):
                delete_component(DELETE_COMPONENT_IN)
Пример #4
0
    def test_1101_correct_input(self):

        self.assertTrue(get_component(GET_COMPONENT_IN)['success'])

        result = delete_component(DELETE_COMPONENT_IN)
        self.assertEqual(result, DELETE_COMPONENT_OUT)

        with self.assertRaises(IndexError):
            get_component(GET_COMPONENT_IN)
Пример #5
0
def delete_component(input_dict: dict) -> str:
    """
    Calls the delete_component method and returns whether successful or not in JSON Format

    :param input_dict: dict containing the component uid
    :type input_dict: dict
    :return: A JSON object containing the success state, which is True or False
    """

    result_dict = component_handler.delete_component(input_dict)
    output_json = processing.dict_to_json(result_dict)

    return output_json
Пример #6
0
 def tearDownClass(cls):
     UID_DICT["uid"] = cls.uid
     delete_process(UID_DICT)
     UID_DICT["uid"] = cls.componentUid
     delete_component(UID_DICT)
Пример #7
0
    def tearDownClass(cls):

        for uid in cls.uid:
            DELETE_COMPONENT_IN['uid'] = uid
            delete_component(DELETE_COMPONENT_IN)
Пример #8
0
    def test_1104_incorrect_input(self):
        with self.assertRaises(KeyError):
            delete_component({"test": 1, "test2": 2})

        with self.assertRaises(TypeError):
            delete_component('abc')