- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 182 for within (0.68 sec)
-
tests/test_tutorial/test_events/test_tutorial002.py
@pytest.fixture(name="app", scope="module") def get_app(): with pytest.warns(DeprecationWarning): from docs_src.events.tutorial002 import app yield app def test_events(app: FastAPI): with TestClient(app) as client: response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}] with open("log.txt") as log:
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial001.py
def test_main(): response = client.get("/") assert response.status_code == 200, response.text assert b"<!DOCTYPE html>" in response.content def test_websocket(): with pytest.raises(WebSocketDisconnect): with client.websocket_connect("/ws") as websocket: message = "Message one" websocket.send_text(message) data = websocket.receive_text()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 10 09:08:19 GMT 2020 - 822 bytes - Viewed (0) -
tests/test_openapi_query_parameter_extension.py
"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/": { "get": { "summary": "Route With Extra Query Parameters", "operationId": "route_with_extra_query_parameters__get", "parameters": [ { "required": False, "schema": IsDict(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.7K bytes - Viewed (0) -
tests/test_tutorial/test_sql_databases/test_sql_databases.py
from docs_src.sql_databases.sql_app import main # Ensure import side effects are re-executed importlib.reload(main) with TestClient(main.app) as c: yield c if test_db.is_file(): # pragma: nocover test_db.unlink() os.chdir(cwd) # TODO: pv2 add version with Pydantic v2 @needs_pydanticv1 def test_create_user(client): test_user = {"email": "******@****.***", "password": "secret"}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Mar 13 19:07:10 GMT 2024 - 16.1K bytes - Viewed (0) -
tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py
# Ensure import side effects are re-executed importlib.reload(alt_main) with TestClient(alt_main.app) as c: yield c if test_db.is_file(): # pragma: nocover test_db.unlink() os.chdir(cwd) @needs_py310 # TODO: pv2 add version with Pydantic v2 @needs_pydanticv1 def test_create_user(client):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Mar 13 19:07:10 GMT 2024 - 16.5K bytes - Viewed (0) -
tests/test_schema_extra_examples.py
), ): return item_id with pytest.warns(DeprecationWarning): @app.get("/path_example_examples/{item_id}") def path_example_examples( item_id: str = Path( example="item_overridden", examples=["item_1", "item_2"], ), ): return item_id with pytest.warns(DeprecationWarning):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 37.7K bytes - Viewed (0) -
tests/test_webhooks_security.py
@app.webhooks.post("new-subscription") def new_subscription( body: Subscription, token: Annotated[str, Security(bearer_scheme)] ): """ When a new user subscribes to your service we'll send you a POST request with this data to the URL that you register for the event `new-subscription` in the dashboard. """ client = TestClient(app) def test_dummy_webhook(): # Just for coverage
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Oct 20 09:00:44 GMT 2023 - 4.6K bytes - Viewed (0) -
docs/sts/client_grants/__init__.py
from .sts_element import STSElement class ClientGrantsCredentialProvider(CredentialProvider): """ ClientGrantsCredentialProvider implements CredentialProvider compatible implementation to be used with boto_session """ METHOD = 'assume-role-client-grants' CANONICAL_NAME = 'AssumeRoleClientGrants' def __init__(self, cid, csec,
Python - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri Apr 23 18:58:53 GMT 2021 - 4.6K bytes - Viewed (1) -
tests/test_tutorial/test_request_files/test_tutorial001_03_an.py
client = TestClient(app) with path.open("rb") as file: response = client.post("/files/", files={"file": file}) assert response.status_code == 200, response.text assert response.json() == {"file_size": 14} def test_post_upload_file(tmp_path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") client = TestClient(app) with path.open("rb") as file:
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 6K bytes - Viewed (0) -
docs_src/events/tutorial002.py
from fastapi import FastAPI app = FastAPI() @app.on_event("shutdown") def shutdown_event(): with open("log.txt", mode="a") as log: log.write("Application shutdown") @app.get("/items/") async def read_items():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 255 bytes - Viewed (0)