mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-26 05:51:29 +00:00
test(websocket): ping pong test
This commit is contained in:
parent
c19fa227c9
commit
02d337c3f0
|
@ -29,7 +29,7 @@ def test_websocket_connection_bare(authorized_client):
|
||||||
assert websocket.scope is not None
|
assert websocket.scope is not None
|
||||||
|
|
||||||
|
|
||||||
def test_websocket_graphql_init(authorized_client):
|
def test_websocket_graphql_ping(authorized_client):
|
||||||
client = authorized_client
|
client = authorized_client
|
||||||
with client.websocket_connect(
|
with client.websocket_connect(
|
||||||
"/graphql", subprotocols=["graphql-transport-ws"]
|
"/graphql", subprotocols=["graphql-transport-ws"]
|
||||||
|
@ -38,6 +38,11 @@ def test_websocket_graphql_init(authorized_client):
|
||||||
ack = websocket.receive_json()
|
ack = websocket.receive_json()
|
||||||
assert ack == {"type": "connection_ack"}
|
assert ack == {"type": "connection_ack"}
|
||||||
|
|
||||||
|
# https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md#ping
|
||||||
|
websocket.send_json({"type": "ping", "payload": {}})
|
||||||
|
pong = websocket.receive_json()
|
||||||
|
assert pong == {"type": "pong"}
|
||||||
|
|
||||||
|
|
||||||
# def test_websocket_subscription(authorized_client):
|
# def test_websocket_subscription(authorized_client):
|
||||||
# client = authorized_client
|
# client = authorized_client
|
||||||
|
|
Loading…
Reference in a new issue