- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for isopen (0.15 sec)
-
tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
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"}, files={"file": filea, "fileb": ("testb.txt", fileb, "text/plain")}, )
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 9.9K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
} ] } ) @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}) assert response.status_code == 200, response.text assert response.json() == {"file_size": 14} @needs_py39
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.7K bytes - Viewed (0)