code: def test_post_upload_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("/uploadfile/", files={"file": file})
      assert response.status_code == 200, response.text
      assert response.json() == {"filename": "test.txt"}
  
imports: import pytest
  from fastapi.testclient import TestClient
  from ...utils import needs_py39
label_desc: Use image node_id 3 for calling a global function with example usage: test_post_upload_file(tmp_path, client) without return types