Skip to content

Commit

Permalink
test: update api_performance test to USDT
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Jan 18, 2025
1 parent e9eee11 commit 5d3a056
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions tests/rpc/test_rpc_apiserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
CURRENT_TEST_STRATEGY,
EXMS,
create_mock_trades,
create_mock_trades_usdt,
get_mock_coro,
get_patched_freqtradebot,
log_has,
Expand Down Expand Up @@ -1156,27 +1157,35 @@ def test_api_performance(botclient, fee):
ftbot, client = botclient
patch_get_signal(ftbot)

create_mock_trades(fee)
create_mock_trades_usdt(fee)

rc = client_get(client, f"{BASE_URI}/performance")
assert_response(rc)
assert len(rc.json()) == 2
assert len(rc.json()) == 3
assert rc.json() == [
{
"count": 1,
"pair": "ETC/BTC",
"profit": 0.5,
"profit_pct": 0.5,
"profit_ratio": 0.005,
"profit_abs": 0.000584127,
"pair": "NEO/USDT",
"profit": 5.0,
"profit_pct": 5,
"profit_ratio": 0.05,
"profit_abs": 3.9875,
},
{
"count": 1,
"pair": "XRP/USDT",
"profit": 10.0,
"profit_abs": 2.8425,
"profit_pct": 10.0,
"profit_ratio": 0.1,
},
{
"count": 1,
"pair": "XRP/BTC",
"profit": 1.0,
"profit_pct": 1.0,
"profit_ratio": 0.01,
"profit_abs": 0.000155,
"pair": "LTC/USDT",
"profit": -20.0,
"profit_abs": -4.09,
"profit_pct": -20.0,
"profit_ratio": -0.2,
},
]

Expand Down

0 comments on commit 5d3a056

Please sign in to comment.