- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 23 for mock (0.16 sec)
-
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 21 07:19:11 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 2.9K bytes - Viewed (0) -
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 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 14.7K bytes - Viewed (4) -
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 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 15K bytes - Viewed (1) -
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 Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 7.4K bytes - Viewed (0) -
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 Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 18:19:17 GMT 2024 - 38.9K bytes - Viewed (0) -
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 Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 34.3K bytes - Viewed (0) -
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 Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 37.4K bytes - Viewed (0) -
docs/ja/docs/tutorial/body-nested-models.md
Plain Text - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 8.7K bytes - Viewed (0) -
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 Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.3K bytes - Viewed (0) -
docs/em/docs/tutorial/body-nested-models.md
Plain Text - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.2K bytes - Viewed (0)