Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure multipart subscriptions work as usual when single request is p…
Browse files Browse the repository at this point in the history
…assed in (even though batching is enabled)
aryaniyaps committed Jan 15, 2025
1 parent 9ba0109 commit f0d14ef
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/http/test_query_batching.py
Original file line number Diff line number Diff line change
@@ -122,6 +122,23 @@ async def test_returns_error_for_multipart_subscriptions(
assert "Batching is not supported for multipart subscriptions" in response.text


async def test_single_multipart_subscription_works_without_batching(
multipart_subscriptions_batch_http_client: HttpClient,
):
response = await multipart_subscriptions_batch_http_client.post(
url="/graphql",
json={"query": 'subscription { echo(message: "Hello world", delay: 0.2) }'},
headers={
"content-type": "application/json",
"accept": "multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
},
)
assert response.status_code == 200
assert response.headers["content-type"].startswith(
"multipart/mixed;boundary=graphql"
)


async def test_returns_error_when_trying_too_many_operations(
http_client_class: type[HttpClient],
):

0 comments on commit f0d14ef

Please sign in to comment.