Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for and (0.15 sec)

  1. tests/test_tutorial/test_response_headers/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_headers.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/headers-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 378 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_dataclasses/test_tutorial002.py

        response = client.get("/items/next")
        assert response.status_code == 200
        assert response.json() == {
            "name": "Island In The Moon",
            "price": 12.99,
            "description": "A place to be be playin' and havin' fun",
            "tags": ["breater"],
            "tax": None,
        }
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_response_cookies/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_cookies.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.post("/cookie-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Come to the dark side, we have cookies"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 414 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.custom_request_and_route.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_endpoint_works():
        response = client.post("/", json=[1, 2, 3])
        assert response.json() == 6
    
    
    def test_exception_handler_body_access():
        response = client.post("/", json={"numbers": [1, 2, 3]})
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_websockets/test_tutorial002.py

                data = websocket.receive_text()
                assert data == f"Message text was: {message}, for item ID: bar"
    
    
    def test_websocket_with_header_and_query():
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/2/ws?q=3&token=some-token") as websocket:
                message = "Message one"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 3.6K bytes
    - Viewed (0)
Back to top