- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 98 for path3b (0.07 sec)
-
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
}, ] } def test_post_files_and_token(tmp_path, app: FastAPI): patha = tmp_path / "test.txt" pathb = tmp_path / "testb.txt" patha.write_text("<file content>") pathb.write_text("<file b content>") client = TestClient(app) with patha.open("rb") as filea, pathb.open("rb") as fileb: response = client.post( "/files/", data={"token": "foo"},Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.3K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial002.py
} ] } def test_post_files(tmp_path, app: FastAPI): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") path2 = tmp_path / "test2.txt" path2.write_bytes(b"<file content2>") client = TestClient(app) with path.open("rb") as file, path2.open("rb") as file2: response = client.post( "/files/", files=(Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 8.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02.py
def test_post_file(tmp_path: Path, client: TestClient): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") 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, client: TestClient):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.4K bytes - Viewed (0) -
scripts/translate.py
return yaml.safe_load(Path("docs/language_names.yml").read_text(encoding="utf-8")) def generate_lang_path(*, lang: str, path: Path) -> Path: en_docs_path = Path("docs/en/docs") assert str(path).startswith(str(en_docs_path)), ( f"Path must be inside {en_docs_path}" ) lang_docs_path = Path(f"docs/{lang}/docs") out_path = Path(str(path).replace(str(en_docs_path), str(lang_docs_path)))
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:05:53 UTC 2025 - 34.1K bytes - Viewed (0) -
tests/test_request_params/test_header/test_optional_str.py
client = TestClient(app) response = client.get(path, headers={"p": "hello"}) assert response.status_code == 200 assert response.json() == {"p": None} @pytest.mark.parametrize( "path", [ "/optional-alias", "/model-optional-alias", ], ) def test_optional_alias_by_alias(path: str): client = TestClient(app)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 8.2K bytes - Viewed (0) -
tests/test_request_params/test_header/test_required_str.py
async def read_model_required_str(p: Annotated[HeaderModelRequiredStr, Header()]): return {"p": p.p} @pytest.mark.parametrize( "path", ["/required-str", "/model-required-str"], ) def test_required_str_schema(path: str): assert app.openapi()["paths"][path]["get"]["parameters"] == [ { "required": True, "schema": {"title": "P", "type": "string"}, "name": "p",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 10K bytes - Viewed (0) -
tests/test_request_params/test_query/test_optional_list.py
p: Annotated[QueryModelOptionalListStr, Query()], ): return {"p": p.p} @pytest.mark.parametrize( "path", ["/optional-list-str", "/model-optional-list-str"], ) def test_optional_list_str_schema(path: str): assert app.openapi()["paths"][path]["get"]["parameters"] == [ { "required": False, "schema": { "anyOf": [
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.1K bytes - Viewed (0) -
tests/test_request_params/test_query/test_required_str.py
async def read_model_required_str(p: Annotated[QueryModelRequiredStr, Query()]): return {"p": p.p} @pytest.mark.parametrize( "path", ["/required-str", "/model-required-str"], ) def test_required_str_schema(path: str): assert app.openapi()["paths"][path]["get"]["parameters"] == [ { "required": True, "schema": {"title": "P", "type": "string"}, "name": "p",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.9K bytes - Viewed (0) -
tests/test_request_params/test_header/test_list.py
def read_model_required_list_str(p: Annotated[HeaderModelRequiredListStr, Header()]): return {"p": p.p} @pytest.mark.parametrize( "path", ["/required-list-str", "/model-required-list-str"], ) def test_required_list_str_schema(path: str): assert app.openapi()["paths"][path]["get"]["parameters"] == [ { "required": True, "schema": { "title": "P",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:31:34 UTC 2025 - 11K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001.py
"msg": "Field required", "input": None, } ] } def test_post_file(tmp_path, client: TestClient): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") 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}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.1K bytes - Viewed (0)