Commit e0c6c5ef authored by Giuseppe Tropea's avatar Giuseppe Tropea
Browse files

Merge remote-tracking branch 'origin/hardening/038s' into parsespec

parents 0ded9685 75a2fe20
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ class Checks:
                Checks.check_response_body_title_when_using_session_request,
            'Check Response Body Containing ProblemDetails Element Containing Title Element':
                Checks.check_response_body_containing_problemdetails_element_containing_title_element,
            'Check Dictionary Might Contain Additional Members':
                Checks.check_dictionary_might_contain_additional_members,
            'Check Response Body Containing ProblemDetails Element':
                Checks.check_response_body_containing_problemdetails_element,
            'Check RL Response Body Containing ProblemDetails Element Containing Type Element set to':
@@ -137,6 +139,10 @@ class Checks:
                'params': ['response_body'],
                'position': [0]
            },
            'Check Dictionary Might Contain Additional Members': {
                'params': ['dictionary', 'key'],
                'position': [0, 1]
            },
            'Check Response Headers Containing URI set to': {
                'params': ['expected_entity_id', 'response_headers'],
                'position': [0, 1]
@@ -443,6 +449,13 @@ class Checks:
    def check_response_headers_id_not_empty(kwargs: list) -> str:
        return 'Response Header: Location is not Empty'

    @staticmethod
    def check_dictionary_might_contain_additional_members(kwargs: list) -> str:
        if 'dictionary' in kwargs and 'key' in kwargs:
            return f"The dictionary `{kwargs['dictionary']}' might contain the key '{kwargs['key']}'"
        else:
            raise Exception(f"ERROR, Expected 'dictionary' and 'key' parameters but received: {kwargs}")

    @staticmethod
    def check_response_body_containing_an_attribute_set_to(kwargs: list) -> str:
        expected_parameters = ['checks', 'expected_attribute_name', 'response_body', 'expected_attribute_value']
+1 −1
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ class GenerateRobotData:
        #     pics = f'PICS_{tags[0]}'
        #
        # return reference, pics
        aux = [x for x in tags if match(pattern=r'^(\d+_\d+_\d+)', string=x)]
        aux = [x for x in tags if match(pattern=r'^(\d+_\d+_\d+)|^(\d+_\d+)', string=x)]

        if len(aux) == 0:
            raise Exception(