|
19 | 19 | from openapi_schema_validator import OAS30Validator |
20 | 20 | from openapi_schema_validator import OAS30WriteValidator |
21 | 21 | from openapi_schema_validator import OAS31Validator |
| 22 | +from openapi_schema_validator import OAS32Validator |
22 | 23 | from openapi_schema_validator import oas30_format_checker |
23 | 24 | from openapi_schema_validator import oas30_strict_format_checker |
24 | 25 | from openapi_schema_validator import oas31_format_checker |
| 26 | +from openapi_schema_validator import oas32_format_checker |
25 | 27 |
|
26 | 28 |
|
27 | 29 | class TestOAS30ValidatorFormatChecker: |
@@ -1003,6 +1005,29 @@ def test_array_prefixitems_invalid(self, validator_class, value): |
1003 | 1005 | assert any(error in str(excinfo.value) for error in errors) |
1004 | 1006 |
|
1005 | 1007 |
|
| 1008 | +class TestOAS32ValidatorValidate(TestOAS31ValidatorValidate): |
| 1009 | + """OAS 3.2 uses the same JSON Schema dialect as 3.1.""" |
| 1010 | + |
| 1011 | + @pytest.fixture |
| 1012 | + def validator_class(self): |
| 1013 | + return OAS32Validator |
| 1014 | + |
| 1015 | + @pytest.fixture |
| 1016 | + def format_checker(self): |
| 1017 | + return oas32_format_checker |
| 1018 | + |
| 1019 | + def test_validator_is_distinct_from_oas31(self): |
| 1020 | + assert OAS32Validator is not OAS31Validator |
| 1021 | + |
| 1022 | + def test_format_checker_is_distinct_from_oas31(self): |
| 1023 | + assert oas32_format_checker is not oas31_format_checker |
| 1024 | + |
| 1025 | + def test_validator_shares_oas31_behavior(self): |
| 1026 | + assert ( |
| 1027 | + OAS32Validator.VALIDATORS == OAS31Validator.VALIDATORS |
| 1028 | + ) |
| 1029 | + |
| 1030 | + |
1006 | 1031 | class TestOAS30StrictValidator: |
1007 | 1032 | """ |
1008 | 1033 | Tests for OAS30StrictValidator which follows OAS spec strictly: |
|
0 commit comments