Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for test_get_api_route (0.14 sec)

  1. tests/test_duplicate_models_openapi.py

    
    class Model3(BaseModel):
        c: Model
        d: Model2
    
    
    @app.get("/", response_model=Model3)
    def f():
        return {"c": {}, "d": {"a": {}}}
    
    
    client = TestClient(app)
    
    
    def test_get_api_route():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert response.json() == {"c": {}, "d": {"a": {}}}
    
    
    def test_openapi_schema():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  2. tests/test_extra_routes.py

    
    @app.trace("/items/{item_id}")
    def trace_item(item_id: str):
        return JSONResponse(None, media_type="message/http")
    
    
    client = TestClient(app)
    
    
    def test_get_api_route():
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"item_id": "foo"}
    
    
    def test_get_api_route_not_decorated():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 13.7K bytes
    - Viewed (0)
Back to top