From a6d76cad392c316306affcb64436a35bca3714db Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Apr 2025 10:24:34 +0200 Subject: [PATCH] test: improve api test to ensure the default is what we expect --- tests/rpc/test_rpc_apiserver.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 901a08c67..89251233b 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -776,6 +776,10 @@ def test_api_trades(botclient, mocker, fee, markets, is_short): assert rc.json()["trades_count"] == 2 assert rc.json()["total_trades"] == 2 assert rc.json()["trades"][0]["is_short"] == is_short + # Ensure the trades are sorted by trade_id (the default, see below) + assert rc.json()["trades"][0]["trade_id"] == 2 + assert rc.json()["trades"][1]["trade_id"] == 3 + rc = client_get(client, f"{BASE_URI}/trades?limit=1") assert_response(rc) assert len(rc.json()["trades"]) == 1