Search Options

Results per page
Sort
Preferred Languages
Advance

Results 311 - 320 of 1,107 for asset1 (0.05 sec)

  1. tests/test_router_redirect_slashes.py

            return "Hello, World!"
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
        response = client.get("/hello", follow_redirects=False)
        assert response.status_code == 307
    
    
    def test_redirect_slashes_disabled():
        app = FastAPI(redirect_slashes=False)
        router = APIRouter()
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jun 22 10:37:50 UTC 2023
    - 974 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py

            name: Deadpoolio
            tags:
            - x-force
            - x-men
            - x-avengers
            """
        response = client.post("/items/", content=yaml_data)
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Deadpoolio",
            "tags": ["x-force", "x-men", "x-avengers"],
        }
    
    
    @needs_pydanticv2
    def test_post_broken_yaml(client: TestClient):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py

        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    
    @needs_py39
    def test_get(client: TestClient):
        response = client.get("/items/plumbus")
        assert response.status_code == 200, response.text
        assert response.json() == "plumbus"
    
    
    @needs_py39
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial008b_an.py

    client = TestClient(app)
    
    
    def test_get_no_item():
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_owner_error():
        response = client.get("/items/plumbus")
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Owner error: Rick"}
    
    
    def test_get_item():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Dec 26 20:37:34 UTC 2023
    - 700 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py

    client = TestClient(app, root_path="/api/v1")
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial001_02_an.py

    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    def test_post_uploadfile_no_body():
        response = client.post("/uploadfile/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No upload file sent"}
    
    
    def test_post_file(tmp_path):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  7. tests/test_openapi_separate_input_output_schemas.py

        response = client.post("/items/", json={"name": "Plumbus"})
        response2 = client_no.post("/items/", json={"name": "Plumbus"})
        assert response.status_code == response2.status_code == 200, response.text
        assert (
            response.json()
            == response2.json()
            == {"name": "Plumbus", "description": None, "sub": None}
        )
    
    
    def test_create_item_with_sub():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_updates/test_tutorial001_py39.py

        )
        assert response.json() == {
            "name": "Barz",
            "description": None,
            "price": 3,
            "tax": 10.5,
            "tags": [],
        }
    
    
    @needs_py39
    @needs_pydanticv2
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 28 04:14:40 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_websockets/test_tutorial001.py

    from fastapi.websockets import WebSocketDisconnect
    
    from docs_src.websockets.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    def test_websocket():
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/ws") as websocket:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 09:08:19 UTC 2020
    - 822 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_header_params/test_tutorial001_an.py

    )
    def test(path, headers, expected_status, expected_response):
        response = client.get(path, headers=headers)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top