Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Garg (0.18 sec)

  1. tests/test_callable_endpoint.py

    from fastapi.testclient import TestClient
    
    
    def main(some_arg, q: Optional[str] = None):
        return {"some_arg": some_arg, "q": q}
    
    
    endpoint = partial(main, "foo")
    
    app = FastAPI()
    
    app.get("/")(endpoint)
    
    
    client = TestClient(app)
    
    
    def test_partial():
        response = client.get("/?q=bar")
        data = response.json()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 28 18:13:30 GMT 2020
    - 457 bytes
    - Viewed (0)
Back to top