Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for test_get_custom_response (0.1 sec)

  1. tests/test_tutorial/test_custom_response/test_tutorial001b.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial001b_py39 import app
    
    client = TestClient(app)
    
    
    def test_get_custom_response():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_custom_response/test_tutorial001.py

        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.custom_response.{request.param}")
        client = TestClient(mod.app)
        return client
    
    
    def test_get_custom_response(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.json() == [{"item_id": "Foo"}]
    
    
    def test_openapi_schema(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_custom_response/test_tutorial002_tutorial003_tutorial004.py

    html_contents = """
        <html>
            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
    
    
    def test_get_custom_response(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.text == html_contents
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.8K bytes
    - Viewed (0)
Back to top