MCPcopy Index your code
hub / github.com/Tong89/smartNode / test_documented_paths_exist

Function test_documented_paths_exist

tests/test_openapi_contract.py:19–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def test_documented_paths_exist():
20 import backend.api as api
21 api.simulation_engine.running = False
22 routes = _real_routes(api.app)
23 missing = []
24 for path, methods in OPENAPI_SPEC["paths"].items():
25 if path not in routes:
26 missing.append(path)
27 continue
28 for method in methods:
29 if method.upper() not in routes[path]:
30 missing.append(f"{method.upper()} {path}")
31 assert not missing, f"OpenAPI 声明但路由缺失: {missing}"
32
33
34def test_spec_is_openapi_31():

Callers

nothing calls this directly

Calls 2

_real_routesFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected