MCPcopy
hub / github.com/encode/httpx / test_multipart_invalid_value

Function test_multipart_invalid_value

tests/test_multipart.py:114–121  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

112
113@pytest.mark.parametrize(("value"), (object(), {"key": "value"}))
114def test_multipart_invalid_value(value):
115 client = httpx.Client(transport=httpx.MockTransport(echo_request_content))
116
117 data = {"text": value}
118 files = {"file": io.BytesIO(b"<file content>")}
119 with pytest.raises(TypeError) as e:
120 client.post("http://127.0.0.1:8000/", data=data, files=files)
121 assert "Invalid type for value" in str(e.value)
122
123
124def test_multipart_file_tuple():

Callers

nothing calls this directly

Calls 1

postMethod · 0.95

Tested by

no test coverage detected