File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,34 @@ async def test_websocket_subscription_slow_consumer(
320
320
assert count == - 1
321
321
322
322
323
+ @pytest .mark .asyncio
324
+ @pytest .mark .parametrize ("server" , [server_countdown ], indirect = True )
325
+ @pytest .mark .parametrize ("subscription_str" , [countdown_subscription_str ])
326
+ async def test_websocket_subscription_with_operation_name (
327
+ event_loop , client_and_server , subscription_str
328
+ ):
329
+
330
+ session , server = client_and_server
331
+
332
+ count = 10
333
+ subscription = gql (subscription_str .format (count = count ))
334
+
335
+ async for result in session .subscribe (
336
+ subscription , operation_name = "CountdownSubscription"
337
+ ):
338
+
339
+ number = result ["number" ]
340
+ print (f"Number received: { number } " )
341
+
342
+ assert number == count
343
+ count -= 1
344
+
345
+ assert count == - 1
346
+
347
+ # Check that the query contains the operationName
348
+ assert '"operationName": "CountdownSubscription"' in logged_messages [0 ]
349
+
350
+
323
351
WITH_KEEPALIVE = True
324
352
325
353
You can’t perform that action at this time.
0 commit comments