Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for Potter (0.17 sec)

  1. tests/test_additional_responses_router.py

        message: str
    
    
    app = FastAPI()
    router = APIRouter()
    
    
    @router.get("/a", responses={501: {"description": "Error 1"}})
    async def a():
        return "a"
    
    
    @router.get(
        "/b",
        responses={
            502: {"description": "Error 2"},
            "4XX": {"description": "Error with range, upper"},
        },
    )
    async def b():
        return "b"
    
    
    @router.get(
        "/c",
        responses={
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  2. tensorflow/api_template_v1.__init__.py

    _current_module.nn.__path__ = [_module_dir] + _current_module.nn.__path__
    
    del importlib
    
    # Load all plugin libraries from site-packages/tensorflow-plugins if we are
    # running under pip.
    # TODO(gunan): Find a better location for this code snippet.
    from tensorflow.python.framework import load_library as _ll
    from tensorflow.python.lib.io import file_io as _fi
    
    # Get sitepackages directories for the python installation.
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Jan 23 02:14:00 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  3. tests/test_ws_router.py

    def test_router():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router!"
    
    
    def test_prefix_router():
        client = TestClient(app)
        with client.websocket_connect("/prefix/") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router with prefix!"
    
    
    def test_native_prefix_router():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  4. tests/test_default_response_class_router.py

    )
    router_b_override.include_router(router_b_a, prefix="/a")
    router_a.include_router(router_a_a, prefix="/a")
    router_a.include_router(
        router_a_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    app.include_router(router_a, prefix="/a")
    app.include_router(
        router_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    
    
    client = TestClient(app)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 01 20:49:20 GMT 2020
    - 5K bytes
    - Viewed (0)
  5. tensorflow/api_template.__init__.py

    _compat.enable_v2_behavior()
    _major_api_version = 2
    
    
    # Load all plugin libraries from site-packages/tensorflow-plugins if we are
    # running under pip.
    # TODO(gunan): Find a better location for this code snippet.
    from tensorflow.python.framework import load_library as _ll
    from tensorflow.python.lib.io import file_io as _fi
    
    # Get sitepackages directories for the python installation.
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Mar 05 06:27:59 GMT 2024
    - 6.7K bytes
    - Viewed (3)
  6. tests/test_router_redirect_slashes.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    
    def test_redirect_slashes_enabled():
        app = FastAPI()
        router = APIRouter()
    
        @router.get("/hello/")
        def hello_page() -> str:
            return "Hello, World!"
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 22 10:37:50 GMT 2023
    - 974 bytes
    - Viewed (0)
  7. tests/test_empty_router.py

    import pytest
    from fastapi import APIRouter, FastAPI
    from fastapi.exceptions import FastAPIError
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    router = APIRouter()
    
    
    @router.get("")
    def get_empty():
        return ["OK"]
    
    
    app.include_router(router, prefix="/prefix")
    
    
    client = TestClient(app)
    
    
    def test_use_empty():
        with client:
            response = client.get("/prefix")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 22:37:34 GMT 2023
    - 805 bytes
    - Viewed (0)
  8. tests/test_router_events.py

        @sub_router.on_event("shutdown")
        def sub_router_shutdown() -> None:
            state.sub_router_shutdown = True
    
        router.include_router(sub_router)
        app.include_router(router)
    
        assert state.app_startup is False
        assert state.router_startup is False
        assert state.sub_router_startup is False
        assert state.app_shutdown is False
        assert state.router_shutdown is False
        assert state.sub_router_shutdown is False
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  9. tests/test_router_prefix_with_template.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    router = APIRouter()
    
    
    @router.get("/users/{id}")
    def read_user(segment: str, id: str):
        return {"segment": segment, "id": id}
    
    
    app.include_router(router, prefix="/{segment}")
    
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/seg/users/foo")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 484 bytes
    - Viewed (0)
  10. docs_src/sql_databases_peewee/sql_app/schemas.py

        class Config:
            orm_mode = True
            getter_dict = PeeweeGetterDict
    
    
    class UserBase(BaseModel):
        email: str
    
    
    class UserCreate(UserBase):
        password: str
    
    
    class User(UserBase):
        id: int
        is_active: bool
        items: List[Item] = []
    
        class Config:
            orm_mode = True
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 868 bytes
    - Viewed (0)
Back to top