(ws_testdata)
| 375 | |
| 376 | |
| 377 | def test_close_disconnect(ws_testdata): |
| 378 | tctx, playbook, flow = ws_testdata |
| 379 | assert ( |
| 380 | playbook |
| 381 | << websocket.WebsocketStartHook(flow) |
| 382 | >> reply() |
| 383 | >> ConnectionClosed(tctx.server) |
| 384 | << CloseConnection(tctx.server) |
| 385 | << SendData(tctx.client, b"\x88\x02\x03\xe8") |
| 386 | << CloseConnection(tctx.client) |
| 387 | << websocket.WebsocketEndHook(flow) |
| 388 | >> reply() |
| 389 | >> ConnectionClosed(tctx.client) |
| 390 | ) |
| 391 | # The \x03\xe8 above is code 1000 (normal closure). |
| 392 | # But 1006 (ABNORMAL_CLOSURE) is expected, because the connection was already closed. |
| 393 | assert flow.websocket.close_code == 1006 |
| 394 | assert not flow.live |
| 395 | |
| 396 | |
| 397 | def test_close_code(ws_testdata): |
nothing calls this directly
no test coverage detected
searching dependent graphs…