44from openapi_spec_validator import OpenAPIV30SpecValidator
55from openapi_spec_validator import openapi_v2_spec_validator
66from openapi_spec_validator import openapi_v30_spec_validator
7+ from openapi_spec_validator import validate
78from openapi_spec_validator import validate_spec
89from openapi_spec_validator import validate_spec_url
10+ from openapi_spec_validator import validate_url
911from openapi_spec_validator .validation .exceptions import OpenAPIValidationError
1012from openapi_spec_validator .validation .exceptions import ValidatorDetectError
1113
@@ -15,7 +17,7 @@ def test_spec_schema_version_not_detected(self):
1517 spec = {}
1618
1719 with pytest .raises (ValidatorDetectError ):
18- validate_spec (spec )
20+ validate (spec )
1921
2022
2123class TestLocalValidateSpecUrl :
@@ -24,7 +26,7 @@ def test_spec_schema_version_not_detected(self, factory):
2426 spec_url = factory .spec_file_url (spec_path )
2527
2628 with pytest .raises (ValidatorDetectError ):
27- validate_spec_url (spec_url )
29+ validate_url (spec_url )
2830
2931
3032class TestLiocalValidatev2Spec :
@@ -43,8 +45,8 @@ def test_valid(self, factory, spec_file):
4345 spec_path = self .local_test_suite_file_path (spec_file )
4446 spec = factory .spec_from_file (spec_path )
4547
46- validate_spec (spec )
47- validate_spec (spec , cls = OpenAPIV2SpecValidator )
48+ validate (spec )
49+ validate (spec , cls = OpenAPIV2SpecValidator )
4850 with pytest .warns (DeprecationWarning ):
4951 validate_spec (spec , validator = openapi_v2_spec_validator )
5052
@@ -59,7 +61,7 @@ def test_falied(self, factory, spec_file):
5961 spec = factory .spec_from_file (spec_path )
6062
6163 with pytest .raises (OpenAPIValidationError ):
62- validate_spec (spec , cls = OpenAPIV2SpecValidator )
64+ validate (spec , cls = OpenAPIV2SpecValidator )
6365 with pytest .warns (DeprecationWarning ):
6466 with pytest .raises (OpenAPIValidationError ):
6567 validate_spec (spec , validator = openapi_v2_spec_validator )
@@ -82,9 +84,10 @@ def test_valid(self, factory, spec_file):
8284 spec = factory .spec_from_file (spec_path )
8385 spec_url = factory .spec_file_url (spec_path )
8486
85- validate_spec (spec )
86- validate_spec (spec , spec_url = spec_url )
87- validate_spec (spec , cls = OpenAPIV30SpecValidator )
87+ validate (spec )
88+ with pytest .warns (DeprecationWarning ):
89+ validate_spec (spec , spec_url = spec_url )
90+ validate (spec , cls = OpenAPIV30SpecValidator )
8891 with pytest .warns (DeprecationWarning ):
8992 validate_spec (spec , validator = openapi_v30_spec_validator )
9093
@@ -99,7 +102,7 @@ def test_falied(self, factory, spec_file):
99102 spec = factory .spec_from_file (spec_path )
100103
101104 with pytest .raises (OpenAPIValidationError ):
102- validate_spec (spec , cls = OpenAPIV30SpecValidator )
105+ validate (spec , cls = OpenAPIV30SpecValidator )
103106 with pytest .warns (DeprecationWarning ):
104107 with pytest .raises (OpenAPIValidationError ):
105108 validate_spec (spec , validator = openapi_v30_spec_validator )
@@ -128,9 +131,10 @@ def remote_test_suite_file_path(self, test_file):
128131 def test_valid (self , spec_file ):
129132 spec_url = self .remote_test_suite_file_path (spec_file )
130133
131- validate_spec_url (spec_url )
132- validate_spec_url (spec_url , cls = OpenAPIV2SpecValidator )
134+ validate_url (spec_url )
135+ validate_url (spec_url , cls = OpenAPIV2SpecValidator )
133136 with pytest .warns (DeprecationWarning ):
137+ validate_spec_url (spec_url )
134138 validate_spec_url (spec_url , validator = openapi_v2_spec_validator )
135139
136140
@@ -157,7 +161,7 @@ def remote_test_suite_file_path(self, test_file):
157161 def test_valid (self , spec_file ):
158162 spec_url = self .remote_test_suite_file_path (spec_file )
159163
160- validate_spec_url (spec_url )
161- validate_spec_url (spec_url , cls = OpenAPIV30SpecValidator )
164+ validate_url (spec_url )
165+ validate_url (spec_url , cls = OpenAPIV30SpecValidator )
162166 with pytest .warns (DeprecationWarning ):
163167 validate_spec_url (spec_url , validator = openapi_v30_spec_validator )
0 commit comments