Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
eyurtsev committed Sep 10, 2024
1 parent f9cdab8 commit 704457e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit_tests/test_server_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ async def test_server_async(app: FastAPI) -> None:
# test bad requests
async with get_async_test_client(app, raise_app_exceptions=True) as async_client:
# Test invoke
response = await async_client.post("/invoke", data="bad json []")
response = await async_client.post("/invoke", content="bad json []")
# Client side error bad json.
assert response.status_code == 422

Expand All @@ -353,7 +353,7 @@ async def test_server_async(app: FastAPI) -> None:
async with get_async_test_client(app, raise_app_exceptions=True) as async_client:
# Test invoke
# Test bad batch requests
response = await async_client.post("/batch", data="bad json []")
response = await async_client.post("/batch", content="bad json []")
# Client side error bad json.
assert response.status_code == 422

Expand All @@ -378,15 +378,15 @@ async def test_server_async(app: FastAPI) -> None:
# test stream bad requests
async with get_async_test_client(app, raise_app_exceptions=True) as async_client:
# Test bad stream requests
response = await async_client.post("/stream", data="bad json []")
response = await async_client.post("/stream", content="bad json []")
assert response.status_code == 422

response = await async_client.post("/stream", json={})
assert response.status_code == 422

# test stream_log bad requests
async with get_async_test_client(app, raise_app_exceptions=True) as async_client:
response = await async_client.post("/stream_log", data="bad json []")
response = await async_client.post("/stream_log", content="bad json []")
assert response.status_code == 422

response = await async_client.post("/stream_log", json={})
Expand Down Expand Up @@ -448,7 +448,7 @@ async def test_server_astream_events(app: FastAPI) -> None:

# test stream_events with bad requests
async with get_async_test_client(app, raise_app_exceptions=True) as async_client:
response = await async_client.post("/stream_events", data="bad json []")
response = await async_client.post("/stream_events", content="bad json []")
assert response.status_code == 422

response = await async_client.post("/stream_events", json={})
Expand Down

0 comments on commit 704457e

Please sign in to comment.