- Sort Score
- Result 10 results
- Languages All
Results 411 - 420 of 642 for tutorial007_py39 (0.09 sec)
-
tests/test_tutorial/test_python_types/test_tutorial008.py
from unittest.mock import patch from docs_src.python_types.tutorial008_py39 import process_items def test_process_items(): with patch("builtins.print") as mock_print: process_items({"a": 1.0, "b": 2.5}) assert mock_print.call_count == 4 call_args = [arg.args for arg in mock_print.call_args_list] assert call_args == [ ("a",), (1.0,), ("b",), (2.5,),
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 417 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial002_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers-and-object/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 383 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial001_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"} assert response.headers["X-Cat-Dog"] == "alone in the world"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 431 bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
import pytest from dirty_equals import IsOneOf from fastapi.testclient import TestClient from tests.utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial002_py39"), pytest.param("tutorial002_py310", marks=needs_py310), pytest.param("tutorial002_an_py39"), pytest.param("tutorial002_an_py310", marks=needs_py310), ], )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_metadata/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial003_py39 import app client = TestClient(app) def test_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.5K bytes - Viewed (0) -
docs/ru/docs/advanced/testing-websockets.md
Вы можете использовать тот же `TestClient` для тестирования WebSocket. Для этого используйте `TestClient` с менеджером контекста `with`, подключаясь к WebSocket: {* ../../docs_src/app_testing/tutorial002_py39.py hl[27:31] *} /// note | ПримечаниеRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 655 bytes - Viewed (0) -
tests/test_tutorial/test_response_directly/test_tutorial002.py
import importlib import pytest from fastapi.testclient import TestClient @pytest.fixture( name="client", params=[ pytest.param("tutorial002_py39"), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.response_directly.{request.param}") client = TestClient(mod.app) return client def test_path_operation(client: TestClient):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.7K bytes - Viewed (0) -
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.advanced_middleware.tutorial001_py39 import app def test_middleware(): client = TestClient(app, base_url="https://testserver") response = client.get("/") assert response.status_code == 200, response.text client = TestClient(app) response = client.get("/", follow_redirects=False) assert response.status_code == 307, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 479 bytes - Viewed (0) -
tests/test_tutorial/test_behind_a_proxy/test_tutorial004.py
from fastapi.testclient import TestClient from inline_snapshot import snapshot from docs_src.behind_a_proxy.tutorial004_py39 import app client = TestClient(app) def test_main(): response = client.get("/app") assert response.status_code == 200 assert response.json() == {"message": "Hello World", "root_path": "/api/v1"} def test_openapi_schema(): response = client.get("/openapi.json")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.configure_swagger_ui.tutorial002_py39 import app client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text assert '"syntaxHighlight": false' not in response.text, ( "not used parameters should not be included" ) assert '"syntaxHighlight": {"theme": "obsidian"}' in response.text, (
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.5K bytes - Viewed (0)