Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for stub (0.14 sec)

  1. fastapi/dependencies/utils.py

        dependency_cache = dependency_cache or {}
        sub_dependant: Dependant
        for sub_dependant in dependant.dependencies:
            sub_dependant.call = cast(Callable[..., Any], sub_dependant.call)
            sub_dependant.cache_key = cast(
                Tuple[Callable[..., Any], Tuple[str]], sub_dependant.cache_key
            )
            call = sub_dependant.call
            use_sub_dependant = sub_dependant
            if (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  2. tests/test_openapi_separate_input_output_schemas.py

            == response2.json()
            == {"name": "Plumbus", "description": None, "sub": None}
        )
    
    
    def test_create_item_with_sub():
        client = get_app_client()
        client_no = get_app_client(separate_input_output_schemas=False)
        data = {
            "name": "Plumbus",
            "sub": {"subname": "SubPlumbus", "sub_description": "Sub WTF"},
        }
        response = client.post("/items/", json=data)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 18.4K bytes
    - Viewed (2)
  3. tests/test_dependency_duplicates.py

    @app.post("/no-duplicates")
    async def no_duplicates(item: Item, item2: Item = Depends(dependency)):
        return [item, item2]
    
    
    @app.post("/with-duplicates-sub")
    async def no_duplicates_sub(
        item: Item, sub_items: List[Item] = Depends(sub_duplicate_dependency)
    ):
        return [item, sub_items]
    
    
    def test_no_duplicates_invalid():
        response = client.post("/no-duplicates", json={"item": {"data": "myitem"}})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  4. tests/test_response_model_invalid.py

        with pytest.raises(FastAPIError):
            app = FastAPI()
    
            @app.get("/", response_model=NonPydanticModel)
            def read_root():
                pass  # pragma: nocover
    
    
    def test_invalid_response_model_sub_type_raises():
        with pytest.raises(FastAPIError):
            app = FastAPI()
    
            @app.get("/", response_model=List[NonPydanticModel])
            def read_root():
                pass  # pragma: nocover
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 29 13:04:35 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  5. docs_src/security/tutorial004_py310.py

            detail="Could not validate credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )
        try:
            payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
            username: str = payload.get("sub")
            if username is None:
                raise credentials_exception
            token_data = TokenData(username=username)
        except JWTError:
            raise credentials_exception
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  6. tests/test_include_route.py

    router = APIRouter()
    
    
    @router.route("/items/")
    def read_items(request: Request):
        return JSONResponse({"hello": "world"})
    
    
    app.include_router(router)
    
    client = TestClient(app)
    
    
    def test_sub_router():
        response = client.get("/items/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 496 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

        from docs_src.security.tutorial005_an_py39 import create_access_token
    
        access_token = create_access_token(data={"data": "foo"})
        assert access_token
    
    
    @needs_py39
    def test_token_no_sub(client: TestClient):
        response = client.get(
            "/users/me",
            headers={
                "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiZm9vIn0.9ynBhuYb4e6aW3oJr_K_TBgwcMTDpRToQIE25L57rOE"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial005_py310.py

        from docs_src.security.tutorial005_py310 import create_access_token
    
        access_token = create_access_token(data={"data": "foo"})
        assert access_token
    
    
    @needs_py310
    def test_token_no_sub(client: TestClient):
        response = client.get(
            "/users/me",
            headers={
                "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiZm9vIn0.9ynBhuYb4e6aW3oJr_K_TBgwcMTDpRToQIE25L57rOE"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  9. tests/test_filter_pydantic_sub_model_pv2.py

            return {"name": name, "description": "model-a-desc", "foo": model_c}
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_filter_sub_model(client: TestClient):
        response = client.get("/model/modelA")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "modelA",
            "description": "model-a-desc",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  10. tests/test_dependency_cache.py

    async def get_counter(count: int = Depends(dep_counter)):
        return {"counter": count}
    
    
    @app.get("/sub-counter/")
    async def get_sub_counter(
        subcount: int = Depends(super_dep), count: int = Depends(dep_counter)
    ):
        return {"counter": count, "subcounter": subcount}
    
    
    @app.get("/sub-counter-no-cache/")
    async def get_sub_counter_no_cache(
        subcount: int = Depends(super_dep),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
Back to top