Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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)
  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 (5)
  3. docs/ko/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
    - 7.6K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/body-nested-models.md

        ```
    
    This would mean that **FastAPI** would expect a body similar to:
    
    ```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"
        }
    }
    ```
    
    Again, doing just that declaration, with **FastAPI** you get:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  5. 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)
  6. docs/ja/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
    - 8.7K bytes
    - Viewed (0)
  7. docs/zh/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
    - 9.3K bytes
    - Viewed (0)
  8. docs/em/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
    - 9.2K bytes
    - Viewed (0)
  9. 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)
  10. docs/pt/docs/tutorial/body-nested-models.md

    ```
    
    Isso significa que o **FastAPI** vai esperar um corpo similar à:
    
    ```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"
        }
    }
    ```
    
    Novamente, apenas fazendo essa declaração, com o **FastAPI**, você ganha:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.4K bytes
    - Viewed (0)
Back to top