Commit 75a2fe20 authored by lopezaguilar's avatar lopezaguilar
Browse files

Resolve the missing description of the Check operation 'Check Dictionary Might...

Resolve the missing description of the Check operation 'Check Dictionary Might Contain Additional Members'
parent 0d31a883
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']