test_post_files() — fastapi Function Reference
Architecture documentation for the test_post_files() function in test_tutorial002.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 91bd0f95_584c_f857_853b_4a746e8b7649["test_post_files()"] 867971c8_4eb0_eae6_874c_699c5e8b76d7["test_tutorial002.py"] 91bd0f95_584c_f857_853b_4a746e8b7649 -->|defined in| 867971c8_4eb0_eae6_874c_699c5e8b76d7 style 91bd0f95_584c_f857_853b_4a746e8b7649 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_request_files/test_tutorial002.py lines 58–74
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=(
("files", ("test.txt", file)),
("files", ("test2.txt", file2)),
),
)
assert response.status_code == 200, response.text
assert response.json() == {"file_sizes": [14, 15]}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_post_files() do?
test_post_files() is a function in the fastapi codebase, defined in tests/test_tutorial/test_request_files/test_tutorial002.py.
Where is test_post_files() defined?
test_post_files() is defined in tests/test_tutorial/test_request_files/test_tutorial002.py at line 58.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free