Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for mock (0.16 sec)

  1. docs/en/docs/advanced/testing-dependencies.md

    This provider might be charging you per request, and calling it might take some extra time than if you had a fixed mock user for tests.
    
    You probably want to test the external provider once, but not necessarily call it for every test that runs.
    
    In this case, you can override the dependency that calls that provider, and use a custom dependency that returns a mock user, only for your tests.
    
    ### Use the `app.dependency_overrides` attribute
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_body/test_tutorial001.py

    from unittest.mock import patch
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture
    def client():
        from docs_src.body.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (4)
  3. tests/test_tutorial/test_body/test_tutorial001_py310.py

    from unittest.mock import patch
    
    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture
    def client():
        from docs_src.body.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  4. docs/ru/docs/tutorial/body-nested-models.md

    Это означает, что **FastAPI** будет ожидать тело запроса, аналогичное этому:
    
    ```JSON
    {
        "name": "Foo",
        "description": "The pretender",
        "price": 42.0,
        "tax": 3.2,
        "tags": ["rock", "metal", "bar"],
        "image": {
            "url": "http://example.com/baz.jpg",
            "name": "The Foo live"
        }
    }
    ```
    
    Ещё раз: сделав такое объявление, с помощью **FastAPI** вы получите:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/security/first-steps.md

    You will see something like this:
    
    <img src="/img/tutorial/security/image01.png">
    
    !!! check "Authorize button!"
        You already have a shiny new "Authorize" button.
    
        And your *path operation* has a little lock in the top-right corner that you can click.
    
    And if you click it, you have a little authorization form to type a `username` and `password` (and other optional fields):
    
    <img src="/img/tutorial/security/image02.png">
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  6. docs/ko/docs/deployment/docker.md

    2. `/tmp`를 현재의 워킹 디렉터리로 설정합니다.
    
        이 위치에 우리는 `requirements.txt` 파일을 생성할 것입니다.
    
    3. 이 도커 스테이지에서 Poetry를 설치합니다.
    
    4. 파일 `pyproject.toml`와 `poetry.lock`를 `/tmp` 디렉터리로 복사합니다.
    
        `./poetry.lock*` (`*`로 끝나는) 파일을 사용하기 때문에, 파일이 아직 사용가능하지 않더라도 고장나지 않을 것입니다.
    
    5. `requirements.txt` 파일을 생성합니다.
    
    6. 이것이 마지막 스테이지로, 여기에 위치한 모든 것이 마지막 컨테이너 이미지에 포함될 것입니다.
    
    7. 현재의 워킹 디렉터리를 `/code`로 설정합니다.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  7. docs/en/docs/release-notes.md

    ## 0.30.1
    
    * Add section in docs about [External Links and Articles](https://fastapi.tiangolo.com/external-links/). PR [#341](https://github.com/tiangolo/fastapi/pull/341).
    
    * Remove `Pipfile.lock` from the repository as it is only used by FastAPI contributors (developers of FastAPI itself). See the PR for more details. PR [#340](https://github.com/tiangolo/fastapi/pull/340).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
  8. docs/em/docs/deployment/docker.md

    1️⃣. 👉 🥇 ▶️, ⚫️ 🌟 `requirements-stage`.
    
    2️⃣. ⚒ `/tmp` ⏮️ 👷 📁.
    
        📥 🌐❔ 👥 🔜 🏗 📁 `requirements.txt`
    
    3️⃣. ❎ 🎶 👉 ☁ ▶️.
    
    4️⃣. 📁 `pyproject.toml` &amp; `poetry.lock` 📁 `/tmp` 📁.
    
        ↩️ ⚫️ ⚙️ `./poetry.lock*` (▶️ ⏮️ `*`), ⚫️ 🏆 🚫 💥 🚥 👈 📁 🚫 💪.
    
    5️⃣. 🏗 `requirements.txt` 📁.
    
    6️⃣. 👉 🏁 ▶️, 🕳 📥 🔜 🛡 🏁 📦 🖼.
    
    7️⃣. ⚒ ⏮️ 👷 📁 `/code`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 27.9K bytes
    - Viewed (0)
  9. docs/ja/docs/deployment/docker.md

    ```
    
    1. これは最初のステージで、`requirements-stage`と名付けられます
    2. `/tmp` を現在の作業ディレクトリに設定します
        ここで `requirements.txt` というファイルを生成します。
    
    3. このDockerステージにPoetryをインストールします
    
    4. pyproject.toml`と`poetry.lock`ファイルを`/tmp` ディレクトリにコピーします
    
        `./poetry.lock*`(末尾に`*`)を使用するため、そのファイルがまだ利用できない場合でもクラッシュすることはないです。
    5. requirements.txt`ファイルを生成します
    
    6. これは最後のステージであり、ここにあるものはすべて最終的なコンテナ・イメージに保存されます
    7. 現在の作業ディレクトリを `/code` に設定します
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 44.3K bytes
    - Viewed (0)
  10. .gitignore

    .idea
    .ipynb_checkpoints
    .mypy_cache
    .vscode
    __pycache__
    .pytest_cache
    htmlcov
    dist
    site
    .coverage
    coverage.xml
    .netlify
    test.db
    log.txt
    Pipfile.lock
    env3.*
    env
    docs_build
    site_build
    venv
    docs.zip
    archive.zip
    
    # vim temporary files
    *~
    .*.sw?
    .cache
    
    # macOS
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 13:11:35 GMT 2023
    - 268 bytes
    - Viewed (0)
Back to top