()
| 17 | |
| 18 | |
| 19 | def 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 | |
| 34 | def test_spec_is_openapi_31(): |
nothing calls this directly
no test coverage detected