Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for test_dependency_set_status_code (0.2 sec)

  1. tests/test_response_change_status_code.py

        return result
    
    
    @app.get("/", dependencies=[Depends(parent_dep)])
    async def get_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_dependency_set_status_code():
        response = client.get("/")
        assert response.status_code == 201, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Apr 08 04:37:38 UTC 2020
    - 589 bytes
    - Viewed (0)
  2. tests/test_reponse_set_reponse_code_empty.py

    async def delete_deployment(
        id: int,
        response: Response,
    ) -> Any:
        response.status_code = 400
        return {"msg": "Status overwritten", "id": id}
    
    
    client = TestClient(app)
    
    
    def test_dependency_set_status_code():
        response = client.delete("/1")
        assert response.status_code == 400 and response.content
        assert response.json() == {"msg": "Status overwritten", "id": 1}
    
    
    def test_openapi_schema():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.1K bytes
    - Viewed (0)
Back to top