def test_multi_format_valid_in_values(in_): parameter = ParameterFactory(**{"collectionFormat": MULTI, "in": in_}) try: single_parameter_validator(parameter) except ValidationError as err: errors = err.detail else: errors = {} assert_message_not_in_errors(MESSAGES["collection_format"]["invalid_based_on_in_value"], errors)
def test_default_valid_for_multiple_types(): try: schema_validator({ 'type': [STRING, BOOLEAN, INTEGER], 'default': True, }) except ValidationError as err: errors = err.detail else: errors = {} assert_path_not_in_errors('default', errors) assert_message_not_in_errors(MESSAGES['default']['invalid_type'], errors)
def test_multi_format_valid_in_values(in_): parameter = ParameterFactory(**{ 'collectionFormat': MULTI, 'in': in_, }) try: single_parameter_validator(parameter) except ValidationError as err: errors = err.detail else: errors = {} assert_message_not_in_errors( MESSAGES['collection_format']['invalid_based_on_in_value'], errors, )