Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for from (0.17 sec)

  1. tests/test_security_oauth2_optional.py

    from typing import Optional
    
    from dirty_equals import IsDict
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  2. tests/test_tuples.py

    from typing import List, Tuple
    
    from dirty_equals import IsDict
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class ItemGroup(BaseModel):
        items: List[Tuple[str, str]]
    
    
    class Coordinate(BaseModel):
        x: float
        y: float
    
    
    @app.post("/model-with-tuple/")
    def post_model_with_tuple(item_group: ItemGroup):
        return item_group
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py

    import pytest
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_forms_and_files.tutorial001_an import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_security/test_tutorial005_py39.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.security.tutorial005_py39 import app
    
        client = TestClient(app)
        return client
    
    
    def get_access_token(
        *, username="johndoe", password="secret", scope=None, client: TestClient
    ):
    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)
  5. .github/actions/people/app/main.py

    import logging
    import subprocess
    import sys
    from collections import Counter, defaultdict
    from datetime import datetime, timedelta, timezone
    from pathlib import Path
    from typing import Any, Container, DefaultDict, Dict, List, Set, Union
    
    import httpx
    import yaml
    from github import Github
    from pydantic import BaseModel, SecretStr
    from pydantic_settings import BaseSettings
    
    github_graphql_url = "https://api.github.com/graphql"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  6. .github/actions/notify-translations/app/main.py

    import logging
    import random
    import sys
    import time
    from pathlib import Path
    from typing import Any, Dict, List, Union, cast
    
    import httpx
    from github import Github
    from pydantic import BaseModel, BaseSettings, SecretStr
    
    awaiting_label = "awaiting-review"
    lang_all_label = "lang-all"
    approved_label = "approved-2"
    translations_path = Path(__file__).parent / "translations.yml"
    
    github_graphql_url = "https://api.github.com/graphql"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_sql_databases/test_sql_databases.py

    import importlib
    import os
    from pathlib import Path
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv1
    
    
    @pytest.fixture(scope="module")
    def client(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

    import importlib
    import os
    from pathlib import Path
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310, needs_pydanticv1
    
    
    @pytest.fixture(scope="module")
    def client(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  9. tests/test_schema_extra_examples.py

    from typing import Union
    
    import pytest
    from dirty_equals import IsDict
    from fastapi import Body, Cookie, FastAPI, Header, Path, Query
    from fastapi._compat import PYDANTIC_V2
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, ConfigDict
    
    
    def create_app():
        app = FastAPI()
    
        class Item(BaseModel):
            data: str
    
            if PYDANTIC_V2:
                model_config = ConfigDict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  10. tests/test_dependency_overrides.py

    from typing import Optional
    
    import pytest
    from dirty_equals import IsDict
    from fastapi import APIRouter, Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    router = APIRouter()
    
    
    async def common_parameters(q: str, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/main-depends/")
    async def main_depends(commons: dict = Depends(common_parameters)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15.4K bytes
    - Viewed (0)
Back to top