- Sort Score
- Result 10 results
- Languages All
Results 471 - 480 of 526 for TestClient (0.15 sec)
-
tests/test_tutorial/test_security/test_tutorial005_an.py
from dirty_equals import IsDict, IsOneOf from fastapi.testclient import TestClient from docs_src.security.tutorial005_an import ( app, create_access_token, fake_users_db, get_password_hash, verify_password, ) client = TestClient(app) def get_access_token(username="johndoe", password="secret", scope=None): data = {"username": username, "password": password} if scope: data["scope"] = scope
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Mar 13 19:07:10 UTC 2024 - 15.4K bytes - Viewed (0) -
tests/test_extra_routes.py
from typing import Optional from dirty_equals import IsDict from fastapi import FastAPI from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: Optional[float] = None @app.api_route("/items/{item_id}", methods=["GET"]) def get_items(item_id: str): return {"item_id": item_id}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 13.7K bytes - Viewed (0) -
tests/test_infer_param_optionality.py
from typing import Optional from dirty_equals import IsDict from fastapi import APIRouter, FastAPI from fastapi.testclient import TestClient app = FastAPI() user_router = APIRouter() item_router = APIRouter() @user_router.get("/") def get_users(): return [{"user_id": "u1"}, {"user_id": "u2"}] @user_router.get("/{user_id}") def get_user(user_id: str): return {"user_id": user_id}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 13.3K bytes - Viewed (0) -
tests/test_openapi_examples.py
from typing import Union from dirty_equals import IsDict from fastapi import Body, Cookie, FastAPI, Header, Path, Query from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class Item(BaseModel): data: str @app.post("/examples/") def examples( item: Item = Body( examples=[ {"data": "Data in Body examples, example1"}, ],
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 06 15:57:43 UTC 2024 - 17.7K bytes - Viewed (0) -
tests/test_schema_extra_examples.py
from typing import Union import pytest from dirty_equals import IsDict from fastapi import Body, Cookie, FastAPI, Header, Path, Query from fastapi._compat import PYDANTIC_V2 from fastapi.testclient import TestClient from pydantic import BaseModel, ConfigDict def create_app(): app = FastAPI() class Item(BaseModel): data: str if PYDANTIC_V2: model_config = ConfigDict(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 37.7K bytes - Viewed (0) -
docs/de/docs/advanced/testing-events.md
# Events testen: Hochfahren – Herunterfahren Wenn Sie in Ihren Tests Ihre Event-Handler (`startup` und `shutdown`) ausführen wollen, können Sie den `TestClient` mit einer `with`-Anweisung verwenden: ```Python hl_lines="9-12 20-24" {!../../docs_src/app_testing/tutorial003.py!}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 288 bytes - Viewed (0) -
docs/pt/docs/advanced/testing-events.md
# Testando Eventos: inicialização - encerramento Quando você precisa que os seus manipuladores de eventos (`startup` e `shutdown`) sejam executados em seus testes, você pode utilizar o `TestClient` usando a instrução `with`: ```Python hl_lines="9-12 20-24" {!../../docs_src/app_testing/tutorial003.py!}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 316 bytes - Viewed (0) -
mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionMultipleInstancesTest.kt
) { assertThat(defaultInstance.port).isEqualTo(defaultInstancePort) assertThat(instanceA.port).isEqualTo(instanceAPort) assertThat(instanceB.port).isEqualTo(instanceBPort) } @Test fun testClient( defaultInstance: MockWebServer, @MockWebServerInstance("A") instanceA: MockWebServer, @MockWebServerInstance("B") instanceB: MockWebServer, ) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 2.3K bytes - Viewed (0) -
mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionLifecycleTest.kt
server.enqueue(MockResponse()) } @AfterEach fun afterEach(server: MockWebServer) { assertThat(server).isSameInstanceAs(instanceServer) } @Test fun testClient(server: MockWebServer) { assertThat(server).isSameInstanceAs(instanceServer) clientTestRule.newClient().newCall(Request(server.url("/"))).execute().use { assertThat(it.code).isEqualTo(200) } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 11 12:12:36 UTC 2024 - 3K bytes - Viewed (0) -
tests/test_application.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient from .main import app client = TestClient(app) @pytest.mark.parametrize( "path,expected_status,expected_response", [ ("/api_route", 200, {"message": "Hello World"}), ("/non_decorated_route", 200, {"message": "Hello World"}), ("/nonexistent", 404, {"detail": "Not Found"}), ], )
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 52.2K bytes - Viewed (0)