- Sort Score
- Result 10 results
- Languages All
Results 11 - 19 of 19 for test_post_files (0.15 sec)
-
tests/test_tutorial/test_request_files/test_tutorial001_03_an_py39.py
@pytest.fixture(name="client") def get_client(): from docs_src.request_files.tutorial001_03_an_py39 import app client = TestClient(app) return client @needs_py39 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})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 6.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.7K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_an.py
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_tutorial/test_request_files/test_tutorial001_03.py
from fastapi.testclient import TestClient from docs_src.request_files.tutorial001_03 import app client = TestClient(app) def test_post_file(tmp_path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") client = TestClient(app) with path.open("rb") as file: response = client.post("/files/", files={"file": file}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 6K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02_py310.py
response = client.post("/uploadfile/") assert response.status_code == 200, response.text assert response.json() == {"message": "No upload file sent"} @needs_py310 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})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 8.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02_an_py39.py
response = client.post("/uploadfile/") assert response.status_code == 200, response.text assert response.json() == {"message": "No upload file sent"} @needs_py39 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})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 8.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02.py
def test_post_uploadfile_no_body(): response = client.post("/uploadfile/") assert response.status_code == 200, response.text assert response.json() == {"message": "No upload file sent"} def test_post_file(tmp_path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") client = TestClient(app) with path.open("rb") as file: response = client.post("/files/", files={"file": file})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 8.2K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02_an_py310.py
response = client.post("/uploadfile/") assert response.status_code == 200, response.text assert response.json() == {"message": "No upload file sent"} @needs_py310 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})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 8.5K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 7.7K bytes - Viewed (0)