File tree Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change 99from utils import list_files_in_api_specs
1010from yarl import URL
1111
12+
13+
1214# Conventions
1315_REQUIRED_FIELDS = [
1416 "data" ,
@@ -42,29 +44,3 @@ def test_openapi_envelope_required_fields(path: Path):
4244
4345 assert "error" in required_fields or "data" in required_fields
4446 assert "error" in fields_definitions or "data" in fields_definitions
45-
46-
47- main_openapi_yamls = [
48- pathstr
49- for pathstr in list_files_in_api_specs ("openapi.y*ml" )
50- if not f"{ pathstr } " .endswith (CONVERTED_SUFFIX ) and ("director" not in f"{ pathstr } " )
51- ] # skip converted schemas and director
52-
53- assert main_openapi_yamls
54-
55-
56- @pytest .mark .parametrize (
57- "openapi_path" , main_openapi_yamls , ids = lambda p : p .parent .name
58- )
59- def test_versioning_and_basepath (openapi_path : Path ):
60- # version in folder name is only major!
61- with openapi_path .open () as f :
62- oas_dict = yaml .safe_load (f )
63-
64- # basepath in servers must also be as '/v0'
65- for server in oas_dict ["servers" ]:
66- kwargs = {
67- key : value ["default" ] for key , value in server .get ("variables" , {}).items ()
68- }
69- url = URL (server ["url" ].format (** kwargs ))
70- assert url .path == "/" , "Wrong basepath in server: %s" % server
You can’t perform that action at this time.
0 commit comments