Skip to content

Commit

Permalink
test: simplify api_ws_test
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Jan 28, 2025
1 parent 262cfed commit fd4cd11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/rpc/test_rpc_apiserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,16 @@ def url(token):

bad_token = "bad-ws_token"
with pytest.raises(WebSocketDisconnect):
with client.websocket_connect(url(bad_token)) as websocket:
websocket.receive()
with client.websocket_connect(url(bad_token)):
pass

good_token = _TEST_WS_TOKEN
with client.websocket_connect(url(good_token)) as websocket:
with client.websocket_connect(url(good_token)):
pass

jwt_secret = ftbot.config["api_server"].get("jwt_secret_key", "super-secret")
jwt_token = create_token({"identity": {"u": "Freqtrade"}}, jwt_secret)
with client.websocket_connect(url(jwt_token)) as websocket:
with client.websocket_connect(url(jwt_token)):
pass


Expand Down

0 comments on commit fd4cd11

Please sign in to comment.