- Sort Score
- Result 10 results
- Languages All
Results 121 - 130 of 907 for fdef (0.02 sec)
-
tests/test_modules_same_name_body/test_main.py
def test_post_b(): data = {"a": 2, "b": "foo"} response = client.post("/b/compute/", json=data) assert response.status_code == 200, response.text data = response.json() def test_post_b_invalid(): data = {"a": "bar", "b": "foo"} response = client.post("/b/compute/", json=data) assert response.status_code == 422, response.text def test_openapi_schema():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.6K bytes - Viewed (0) -
docs_src/dependencies/tutorial012.py
from fastapi import Depends, FastAPI, Header, HTTPException async def verify_token(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: str = Header()): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 696 bytes - Viewed (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
import pytest from dirty_equals import IsDict from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.body_multiple_params.tutorial001_an import app client = TestClient(app) return client def test_post_body_q_bar_content(client: TestClient): response = client.put("/items/5?q=bar", json={"name": "Foo", "price": 50.5}) assert response.status_code == 200
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.5K bytes - Viewed (0) -
tests/test_no_swagger_ui_redirect.py
from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI(swagger_ui_oauth2_redirect_url=None) @app.get("/items/") async def read_items(): return {"id": "foo"} client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text assert response.headers["content-type"] == "text/html; charset=utf-8"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 786 bytes - Viewed (0) -
tests/test_openapi_separate_input_output_schemas.py
def get_app_client(separate_input_output_schemas: bool = True) -> TestClient: app = FastAPI(separate_input_output_schemas=separate_input_output_schemas) @app.post("/items/", responses={402: {"model": Item}}) def create_item(item: Item) -> Item: return item @app.post("/items-list/") def create_item_list(item: List[Item]): return item
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 09:44:57 UTC 2024 - 19.7K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial014_an_py310.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture(name="client") def get_client(): from docs_src.query_params_str_validations.tutorial014_an_py310 import app client = TestClient(app) return client @needs_py310 def test_hidden_query(client: TestClient): response = client.get("/items?hidden_query=somevalue")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.1K bytes - Viewed (0) -
docs_src/bigger_applications/app_an_py39/routers/users.py
router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username": "Rick"}, {"username": "Morty"}] @router.get("/users/me", tags=["users"]) async def read_user_me(): return {"username": "fakecurrentuser"} @router.get("/users/{username}", tags=["users"]) async def read_user(username: str):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 407 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008b_an_py39 import app client = TestClient(app) return client @needs_py39 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 - 918 bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from docs_src.path_operation_advanced_configuration.tutorial007 import app client = TestClient(app) return client @needs_pydanticv2 def test_post(client: TestClient): yaml_data = """ name: Deadpoolio tags: - x-force - x-men
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 3.3K bytes - Viewed (0) -
tensorflow/c/c_api.cc
return nullptr; } void TF_GraphToGraphDef(TF_Graph* graph, TF_Buffer* output_graph_def, TF_Status* status) { GraphDef def; { mutex_lock l(graph->mu); graph->graph.ToGraphDef(&def); } status->status = MessageToBuffer(def, output_graph_def); } void TF_GraphGetOpDef(TF_Graph* graph, const char* op_name, TF_Buffer* output_op_def, TF_Status* status) {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 16:27:48 UTC 2024 - 102.3K bytes - Viewed (0)