Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. tests/test_tutorial/test_custom_response/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial001 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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_custom_response/test_tutorial001b.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial001b 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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_custom_response/test_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():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
        assert response.text == html_contents
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
Back to top