From 13f115451b85e1dab6d2b35d4f5c8990cde96b38 Mon Sep 17 00:00:00 2001 From: Alexander Prinzhorn Date: Tue, 13 Jul 2021 16:22:10 +0200 Subject: [PATCH] update tests --- test/mitmproxy/proxy/layers/test_websocket.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/mitmproxy/proxy/layers/test_websocket.py b/test/mitmproxy/proxy/layers/test_websocket.py index b58c66e50..7322aa1b6 100644 --- a/test/mitmproxy/proxy/layers/test_websocket.py +++ b/test/mitmproxy/proxy/layers/test_websocket.py @@ -249,6 +249,9 @@ def test_close_disconnect(ws_testdata): >> reply() >> ConnectionClosed(tctx.client) ) + # The \x03\xe8 above is code 1000 (normal closure). + # But 1006 (ABNORMAL_CLOSURE) is expected, because the connection was already closed. + assert flow.websocket.close_code == 1006 def test_close_error(ws_testdata): @@ -265,6 +268,7 @@ def test_close_error(ws_testdata): << websocket.WebsocketEndHook(flow) >> reply() ) + assert flow.websocket.close_code == 4000 def test_deflate(ws_testdata):