- Sort Score
- Result 10 results
- Languages All
Results 211 - 220 of 526 for RestClient (0.08 sec)
-
docs/em/docs/advanced/testing-websockets.md
# ๐ฌ *๏ธโฃ ๐ ๐ช โ๏ธ ๐ `TestClient` ๐ฏ*๏ธโฃ. ๐, ๐ โ๏ธ `TestClient` `with` ๐, ๐*๏ธโฃ: ```Python hl_lines="27-31" {!../../docs_src/app_testing/tutorial002.py!} ``` /// note ๐ โน, โ ๐ ๐งพ <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">๐ฌ *๏ธโฃ </a>.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 371 bytes - Viewed (0) -
tests/test_tutorial/test_response_cookies/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.response_cookies.tutorial002 import app client = TestClient(app) def test_path_operation(): response = client.post("/cookie-and-object/") assert response.status_code == 200, response.text assert response.json() == {"message": "Come to the dark side, we have cookies"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 414 bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial006_an_py39.py
from base64 import b64encode import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.security.tutorial006_an import app client = TestClient(app) return client @needs_py39 def test_security_http_basic(client: TestClient): response = client.get("/users/me", auth=("john", "secret"))
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.5K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008c_an.py
import pytest from fastapi.exceptions import FastAPIError from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008c_an import app client = TestClient(app) return client def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.1K bytes - Viewed (0) -
docs/zh/docs/advanced/testing-websockets.md
# ๆต่ฏ WebSockets ๆต่ฏ WebSockets ไนไฝฟ็จ `TestClient`ใ ไธบๆญค๏ผ่ฆๅจ `with` ่ฏญๅฅไธญไฝฟ็จ `TestClient` ่ฟๆฅ WebSocketใ ```Python hl_lines="27-31" {!../../docs_src/app_testing/tutorial002.py!} ``` /// note | "็ฌ่ฎฐ" ๆดๅค็ป่่ฏฆ่ง <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">Starlette ๅฎๆกฃ - ๆต่ฏ WebSockets</a>ใ
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 418 bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial008.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.custom_response import tutorial008 from docs_src.custom_response.tutorial008 import app client = TestClient(app) def test_get(tmp_path: Path): file_path: Path = tmp_path / "large-video-file.mp4" tutorial008.some_file_path = str(file_path) test_content = b"Fake video bytes" file_path.write_bytes(test_content) response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 487 bytes - Viewed (0) -
tests/test_tutorial/test_wsgi/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.wsgi.tutorial001 import app client = TestClient(app) def test_flask(): response = client.get("/v1/") assert response.status_code == 200, response.text assert response.text == "Hello, World from Flask!" def test_app(): response = client.get("/v2") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 436 bytes - Viewed (1) -
tests/test_tutorial/test_settings/test_tutorial001.py
from fastapi.testclient import TestClient from pytest import MonkeyPatch from ...utils import needs_pydanticv2 @needs_pydanticv2 def test_settings(monkeypatch: MonkeyPatch): monkeypatch.setenv("ADMIN_EMAIL", "******@****.***") from docs_src.settings.tutorial001 import app client = TestClient(app) response = client.get("/info") assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 552 bytes - Viewed (0) -
docs/em/docs/advanced/async-tests.md
`TestClient` ๐จ ๐ฑ ๐ ๐ค ๐ FastAPI ๐ธ ๐ ๐ `def` ๐ฏ ๐ข, โ๏ธ ๐ฉ โณ. โ๏ธ ๐ ๐ฑ ๐ซ ๐ท ๐ซ๐ ๐โ ๐ฅ โ๏ธ โซ๏ธ ๐ ๐ ๐ข. ๐ ๐ ๐ฏ ๐, ๐ฅ ๐ช ๐ โโ ๐ โ๏ธ `TestClient` ๐ ๐ ๐ฏ ๐ข. `TestClient` โ๏ธ ๐ <a href="https://www.python-httpx.org" class="external-link" target="_blank">๐ธ๐ฒ</a>, & โฉ๏ธ, ๐ฅ ๐ช โ๏ธ โซ๏ธ ๐ ๐ฏ ๐ ๏ธ. ## ๐ผ
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d.py
import pytest from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008d import app client = TestClient(app) return client def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.2K bytes - Viewed (0)