Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for mock (0.24 sec)

  1. 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 (5)
  2. 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 (2)
  3. docs/de/docs/tutorial/body-nested-models.md

        ```
    
    Das würde bedeuten, dass **FastAPI** einen Body erwartet wie:
    
    ```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"
        }
    }
    ```
    
    Wiederum, nur mit dieser Deklaration erhalten Sie von **FastAPI**:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  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 May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  5. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  6. docs/zh/docs/deployment/docker.md

    ```
    
    1. 这是第一阶段,称为`requirements-stage`。
    
    2. 将 `/tmp` 设置为当前工作目录。
    
         这是我们生成文件`requirements.txt`的地方
    
    3. 在此阶段安装Poetry。
    
    4. 将`pyproject.toml`和`poetry.lock`文件复制到`/tmp`目录。
    
         因为它使用 `./poetry.lock*` (以 `*` 结尾),所以如果该文件尚不可用,它不会崩溃。
    
    5. 生成`requirements.txt`文件。
    
    6. 这是最后阶段,这里的任何内容都将保留在最终的容器镜像中。
    
    7. 将当前工作目录设置为`/code`。
    
    8. 将 `requirements.txt` 文件复制到 `/code` 目录。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 31.2K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/security/simple-oauth2.md

      "email": "******@****.***",
      "full_name": "John Doe",
      "disabled": false,
      "hashed_password": "fakehashedsecret"
    }
    ```
    
    <img src="/img/tutorial/security/image06.png">
    
    If you click the lock icon and logout, and then try the same operation again, you will get an HTTP 401 error of:
    
    ```JSON
    {
      "detail": "Not authenticated"
    }
    ```
    
    ### Inactive user
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  8. docs/de/docs/deployment/docker.md

        Hier werden wir die Datei `requirements.txt` generieren.
    
    3. Installiere Poetry in dieser Docker-Phase.
    
    4. Kopiere die Dateien `pyproject.toml` und `poetry.lock` in das Verzeichnis `/tmp`.
    
        Da es `./poetry.lock*` verwendet (endet mit einem `*`), stürzt es nicht ab, wenn diese Datei noch nicht verfügbar ist.
    
    5. Generiere die Datei `requirements.txt`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:19:17 GMT 2024
    - 38.9K bytes
    - Viewed (0)
  9. docs/en/docs/deployment/docker.md

        Here's where we will generate the file `requirements.txt`
    
    3. Install Poetry in this Docker stage.
    
    4. Copy the `pyproject.toml` and `poetry.lock` files to the `/tmp` directory.
    
        Because it uses `./poetry.lock*` (ending with a `*`), it won't crash if that file is not available yet.
    
    5. Generate the `requirements.txt` file.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 34K bytes
    - Viewed (0)
  10. docs/pt/docs/deployment/docker.md

        Aqui é onde geraremos o arquivo `requirements.txt`
    
    3. Instale o Poetry nesse estágio do Docker.
    
    4. Copie os arquivos `pyproject.toml` e `poetry.lock` para o diretório `/tmp`.
    
        Porque está usando `./poetry.lock*` (terminando com um `*`), não irá falhar se esse arquivo ainda não estiver disponível.
    
    5. Gere o arquivo `requirements.txt`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 37.4K bytes
    - Viewed (0)
Back to top