Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,022 for Rapp (0.17 sec)

  1. docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py

    
    def override_get_db():
        try:
            db = TestingSessionLocal()
            yield db
        finally:
            db.close()
    
    
    app.dependency_overrides[get_db] = override_get_db
    
    client = TestClient(app)
    
    
    def test_create_user():
        response = client.post(
            "/users/",
            json={"email": "******@****.***", "password": "chimichangas4life"},
        )
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  2. tests/test_ws_router.py

        raise CustomError()
    
    
    def make_app(app=None, **kwargs):
        app = app or FastAPI(**kwargs)
        app.include_router(router)
        app.include_router(prefix_router, prefix="/prefix")
        app.include_router(native_prefix_route)
        return app
    
    
    app = make_app(app)
    
    
    def test_app():
        client = TestClient(app)
        with client.websocket_connect("/") as websocket:
    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)
  3. docs_src/custom_docs_ui/tutorial002.py

    )
    from fastapi.staticfiles import StaticFiles
    
    app = FastAPI(docs_url=None, redoc_url=None)
    
    app.mount("/static", StaticFiles(directory="static"), name="static")
    
    
    @app.get("/docs", include_in_schema=False)
    async def custom_swagger_ui_html():
        return get_swagger_ui_html(
            openapi_url=app.openapi_url,
            title=app.title + " - Swagger UI",
            oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

    from fastapi.websockets import WebSocketDisconnect
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.websockets.tutorial002_an_py39 import app
    
        return app
    
    
    @needs_py39
    def test_main(app: FastAPI):
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  5. docs_src/custom_docs_ui/tutorial001.py

        get_swagger_ui_html,
        get_swagger_ui_oauth2_redirect_html,
    )
    
    app = FastAPI(docs_url=None, redoc_url=None)
    
    
    @app.get("/docs", include_in_schema=False)
    async def custom_swagger_ui_html():
        return get_swagger_ui_html(
            openapi_url=app.openapi_url,
            title=app.title + " - Swagger UI",
            oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_events/test_tutorial002.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial002 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/")
            assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  7. tests/test_dependency_overrides.py

    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)):
        return {"in": "main-depends", "params": commons}
    
    
    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)
  8. tests/test_operations_signatures.py

            app_method = getattr(FastAPI, method_name)
            router_sig = inspect.signature(router_method)
            app_sig = inspect.signature(app_method)
            param: inspect.Parameter
            for key, param in base_sig.parameters.items():
                router_param: inspect.Parameter = router_sig.parameters[key]
                app_param: inspect.Parameter = app_sig.parameters[key]
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon May 27 12:08:13 GMT 2019
    - 934 bytes
    - Viewed (0)
  9. docs_src/settings/tutorial001.py

    from fastapi import FastAPI
    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
        items_per_user: int = 50
    
    
    settings = Settings()
    app = FastAPI()
    
    
    @app.get("/info")
    async def info():
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
            "items_per_user": settings.items_per_user,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 419 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial003_py39.py

    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_files.tutorial003_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    file_required = {
        "detail": [
            {
                "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.6K bytes
    - Viewed (0)
Back to top