Skip to content

Test failure with openapi-schema-validator 0.4.2 #189

Closed
@musicinmybrain

Description

@musicinmybrain
==================================================== FAILURES ====================================================
___________________ TestSpecValidatorIterErrors.test_parameter_custom_format_checker_not_found ___________________

self = <test_exceptions.TestSpecValidatorIterErrors object at 0x7f950b421d90>
validator_v30 = <Proxy at 0x7f950b6cf540 wrapping <openapi_spec_validator.validation.validators.SpecValidator object at 0x7f950bbdd190...bHandler object at 0x7f950bae7910>, 'file': <jsonschema_spec.handlers.urllib.UrllibHandler object at 0x7f950bae7890>})>

    def test_parameter_custom_format_checker_not_found(self, validator_v30):
        spec = {
            "openapi": "3.0.0",
            "info": {
                "title": "Test Api",
                "version": "0.0.1",
            },  
            "paths": {
                "/test/": {
                    "get": {
                        "responses": {
                            "default": {
                                "description": "default response",
                            },  
                        },  
                        "parameters": [
                            {
                                "name": "param1",
                                "in": "query",
                                "schema": {
                                    "type": "string",
                                    "format": "custom",
                                    "default": "customvalue",
                                },
                            },
                        ],
                    },
                },
            },
        }

        errors = validator_v30.iter_errors(spec)

        errors_list = list(errors)
>       assert len(errors_list) == 1
E       assert 0 == 1
E        +  where 0 = len([])

errors     = <generator object SpecValidator.iter_errors at 0x7f950b52b040>
errors_list = []
self       = <test_exceptions.TestSpecValidatorIterErrors object at 0x7f950b421d90>
spec       = {'info': {'title': 'Test Api', 'version': '0.0.1'}, 'openapi': '3.0.0', 'paths': {'/test/': {'get': {'parameters': [{'in': 'query', 'name': 'param1', 'schema': {...}}], 'responses': {'default': {'description': 'default response'}}}}}}
validator_v30 = <Proxy at 0x7f950b6cf540 wrapping <openapi_spec_validator.validation.validators.SpecValidator object at 0x7f950bbdd190...bHandler object at 0x7f950bae7910>, 'file': <jsonschema_spec.handlers.urllib.UrllibHandler object at 0x7f950bae7890>})>

tests/integration/validation/test_exceptions.py:457: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions