From 78d8e8aeaa4d34deaa62e66c321d5fe313cfd3f5 Mon Sep 17 00:00:00 2001 From: Jonas Lundberg Date: Fri, 15 Mar 2024 17:00:20 +0100 Subject: [PATCH] Add api test --- tests/test_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_api.py b/tests/test_api.py index c126408..597c589 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -263,6 +263,15 @@ def test_json_post_body(): assert get_route.called +def test_data_post_body(): + with respx.mock: + url = "https://foo.bar/" + route = respx.post(url, data={"foo": "bar"}) % 201 + response = httpx.post(url, data={"foo": "bar"}, files={"file": b"..."}) + assert response.status_code == 201 + assert route.called + + async def test_raising_content(client): async with MockRouter() as respx_mock: url = "https://foo.bar/"