Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for openapi_prefix (0.34 sec)

  1. tests/test_deprecated_openapi_prefix.py

    from fastapi import FastAPI, Request
    from fastapi.testclient import TestClient
    
    app = FastAPI(openapi_prefix="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
        return {"message": "Hello World", "root_path": request.scope.get("root_path")}
    
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.2K bytes
    - Viewed (0)
Back to top