Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for test_post_file (0.04 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial001.py

                {
                    "type": "missing",
                    "loc": ["body", "file"],
                    "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})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_files/test_tutorial001_02.py

    def test_post_uploadfile_no_body(client: TestClient):
        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, 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 Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002.py

                {
                    "type": "missing",
                    "loc": ["body", "files"],
                    "msg": "Field required",
                    "input": None,
                }
            ]
        }
    
    
    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)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.2K bytes
    - Viewed (0)
Back to top